-
Notifications
You must be signed in to change notification settings - Fork 3.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(appsync): queryDepthLimit and resolverCountLimit props on GraphqlApi #29182
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The pull request linter has failed. See the aws-cdk-automation comment below for failure reasons. If you believe this pull request should receive an exemption, please comment and provide a justification.
A comment requesting an exemption should contain the text Exemption Request
. Additionally, if clarification is needed add Clarification Request
to a comment.
✅ Updated pull request passes all PRLinter validations. Dismissing previous PRLinter review.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the contribution @aerrober. Just some additions needed
|
||
## Query Depth Limits | ||
|
||
There are times during which you may want more granular control over how the API functions during an operation. One such control is adding a limit to the amount of nested levels a query may process. By default, queries are able to process an unlimited amount of nested levels. Limiting queries to a specified amount of nested levels has potential implications for the performance and flexibility of your project. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please split this up into a sentence per line so the raw markdown is more amenable to look at.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed
const api = new appsync.GraphqlApi(this, 'api', { | ||
name: 'LimitQueryDepths', | ||
definition: appsync.Definition.fromFile(path.join(__dirname, 'appsync.schema.graphql')), | ||
queryDepthLimit: 2 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
queryDepthLimit: 2 | |
queryDepthLimit: 2, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed
const api = new appsync.GraphqlApi(this, 'api', { | ||
name: 'LimitResolverCount', | ||
definition: appsync.Definition.fromFile(path.join(__dirname, 'appsync.schema.graphql')), | ||
resolverCountLimit: 2 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
resolverCountLimit: 2 | |
resolverCountLimit: 2, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed
/** | ||
* A number indicating the maximum number of resolvers that should be accepted when handling queries. | ||
* | ||
* @default - No Limit |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
https://docs.aws.amazon.com/appsync/latest/APIReference/API_GraphqlApi.html
"The default value is 0 (or unspecified), which will set the limit to 10000"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added
@@ -442,6 +442,20 @@ export interface GraphqlApiProps { | |||
* @default IntrospectionConfig.ENABLED | |||
*/ | |||
readonly introspectionConfig?: IntrospectionConfig; | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
both of these new props have lower and upper bounds according to the docs: https://docs.aws.amazon.com/appsync/latest/APIReference/API_GraphqlApi.html
They should be documented in their docstrings, checked for at synth time, and also have a unit test for each testing the boundary
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added
Pull request has been modified.
This PR cannot be merged because it has conflicts. Please resolve them. The PR will be considered stale and closed if it remains in an unmergeable state. |
1 similar comment
This PR cannot be merged because it has conflicts. Please resolve them. The PR will be considered stale and closed if it remains in an unmergeable state. |
Thank you for contributing! Your pull request will be updated from main and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork). |
Thank you for contributing! Your pull request will be updated from main and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork). |
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
Thank you for contributing! Your pull request will be updated from main and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork). |
…lApi (aws#29182) ### Issue # (if applicable) No open issue. Cr was based on aws#28500 ### Reason for this change Appsync added two additional fields documented in their CFN [here](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-appsync-graphqlapi.html#cfn-appsync-graphqlapi-resolvercountlimit) that were not previously supported in the L1 construct. ### Description of changes Addition of field `queryDepthLimit` and `resolverCountLimit` ### Description of how you validated changes Unit tests and integration tests were run locally. Additionally a sample app was deployed to validate these features. ### Checklist - [ x] My code adheres to the [CONTRIBUTING GUIDE](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md) and [DESIGN GUIDELINES](https://github.com/aws/aws-cdk/blob/main/docs/DESIGN_GUIDELINES.md) ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
Issue # (if applicable)
No open issue. Cr was based on #28500
Reason for this change
Appsync added two additional fields documented in their CFN here that were not previously supported in the L1 construct.
Description of changes
Addition of field
queryDepthLimit
andresolverCountLimit
Description of how you validated changes
Unit tests and integration tests were run locally. Additionally a sample app was deployed to validate these features.
Checklist
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license