You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(appsync): unstable IDs on resolvers and functions
Fixes an issue that would cause unexpected resource replacement for
appsync resolvers and functions because of construct nesting and ID
generation.
Changes `createResolver` and `createFunction` methods on `GraphQlApi`
and `DataSource` constructs to require explicitly passing an ID.
Additionally changes the scope of the constructs created in
`createResolver` and `createFunction` on the `DataSource` construct to
be `this.api` instead of `this`. This allows users to change the data
sources of resolvers and functions while keeping the IDs stable and
avoiding resource replacement.
This helps to avoid the `only one resolver per field` error that occurs
when deleting a resolver on a field, and adding a new one within the
same deployment.
BREAKING CHANGE: `DataSource.createResolver`,
`DataSource.createFunction`, and `GraphQlApi.createResolver` now require
2 arguments instead of 1.
Fixes: #13269
----
### All Submissions:
* [x] Have you followed the guidelines in our [Contributing guide?](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md)
### Adding new Construct Runtime Dependencies:
* [ ] This PR adds new construct runtime dependencies following the process described [here](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md/#adding-construct-runtime-dependencies)
### New Features
* [ ] Have you added the new feature to an [integration test](https://github.com/aws/aws-cdk/blob/main/INTEGRATION_TESTS.md)?
* [ ] Did you use `yarn integ` to deploy the infrastructure and generate the snapshot (i.e. `yarn integ` without `--dry-run`)?
*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
0 commit comments