Skip to content
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

Merged
merged 7 commits into from
Mar 18, 2024

Conversation

aerrober
Copy link
Contributor

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 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


By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license

@aws-cdk-automation aws-cdk-automation requested a review from a team February 20, 2024 19:26
@github-actions github-actions bot added beginning-contributor [Pilot] contributed between 0-2 PRs to the CDK p2 labels Feb 20, 2024
Copy link
Collaborator

@aws-cdk-automation aws-cdk-automation left a 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.

@aerrober aerrober changed the title feat(appsync): Support for queryDepthLimit and resolverCountLimit Support for queryDepthLimit and resolverCountLimit Feb 20, 2024
@aerrober aerrober changed the title Support for queryDepthLimit and resolverCountLimit feat(appsync): support for queryDepthLimit and resolverCountLimit Feb 20, 2024
@aws-cdk-automation aws-cdk-automation dismissed their stale review February 20, 2024 21:25

✅ Updated pull request passes all PRLinter validations. Dismissing previous PRLinter review.

@aws-cdk-automation aws-cdk-automation added the pr/needs-community-review This PR needs a review from a Trusted Community Member or Core Team Member. label Feb 20, 2024
Copy link
Contributor

@kaizencc kaizencc left a 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.
Copy link
Contributor

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.

Copy link
Contributor Author

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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
queryDepthLimit: 2
queryDepthLimit: 2,

Copy link
Contributor Author

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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
resolverCountLimit: 2
resolverCountLimit: 2,

Copy link
Contributor Author

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
Copy link
Contributor

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"

Copy link
Contributor Author

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;

Copy link
Contributor

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

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added

@kaizencc kaizencc changed the title feat(appsync): support for queryDepthLimit and resolverCountLimit feat(appsync): queryDepthLimit and resolverCountLimit props on GraphqlApi Feb 21, 2024
@aws-cdk-automation aws-cdk-automation removed the pr/needs-community-review This PR needs a review from a Trusted Community Member or Core Team Member. label Feb 21, 2024
@mergify mergify bot dismissed kaizencc’s stale review February 21, 2024 19:47

Pull request has been modified.

@aws-cdk-automation aws-cdk-automation added the pr/needs-community-review This PR needs a review from a Trusted Community Member or Core Team Member. label Feb 21, 2024
@aws-cdk-automation
Copy link
Collaborator

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
@aws-cdk-automation
Copy link
Collaborator

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.

Copy link
Contributor

mergify bot commented Mar 18, 2024

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-cdk-automation aws-cdk-automation removed the pr/needs-community-review This PR needs a review from a Trusted Community Member or Core Team Member. label Mar 18, 2024
Copy link
Contributor

mergify bot commented Mar 18, 2024

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-cdk-automation
Copy link
Collaborator

AWS CodeBuild CI Report

  • CodeBuild project: AutoBuildv2Project1C6BFA3F-wQm2hXv2jqQv
  • Commit ID: 85c2c9b
  • Result: SUCCEEDED
  • Build Logs (available for 30 days)

Powered by github-codebuild-logs, available on the AWS Serverless Application Repository

Copy link
Contributor

mergify bot commented Mar 18, 2024

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).

@mergify mergify bot merged commit ba6d0b3 into aws:main Mar 18, 2024
10 checks passed
ahammond pushed a commit to ahammond/aws-cdk that referenced this pull request Mar 26, 2024
…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*
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
beginning-contributor [Pilot] contributed between 0-2 PRs to the CDK p2
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants