(aws-appsync): resolver replacement issues
See original GitHub issueThere seem to be issues when that come up during appsync deployment when resolvers for specific fields are replaced. If you change the uniqueID of a resolver, this will cause a CFN deployment where the old resolver is removed, and the new one is created. Since only one resolver can exist on a field, this will cause the deployment to fail with Only one resolver is allowed per field
.
Alternatively, this can also result in ‘detached’ resolvers, which are not actually triggered on their corresponding queries.
This may require resolution on the cloudformation or appsync side since the changes being submitted by the CDK are valid and replacing existing resolvers is allowed, though obviously could incur some downtime.
See: https://github.com/aws/aws-cdk/issues/13238 and https://github.com/aws/aws-cdk/issues/12635 for relevant details.
Issue Analytics
- State:
- Created 3 years ago
- Reactions:15
- Comments:26 (9 by maintainers)
Top GitHub Comments
Is this being worked on actively by the Appsync/Cloudformation team?
The CFN error
only one resolver is allowed per field
has been reported on various forums, posts etc all the way back to 2018 and its seems like there is complete silence from the Appsync/Cloudformation team on why this is happening and the only things you can find are various people suggesting different workarounds with renaming resources etc.Can we have an official statement of what is causing the issue and an ETA on a fix? OR if this is user error please explain the correct way to update/replace resolvers and datasources.
@pszabop this is my experience too. I can reliably reproduce the error by first creating the resolver FROM the data source then attempting to change the data source type. Creating the resolver against the data source results in the inability to update it. You’ll need to delete the resolver then re-create it. Does not go over well in production. In my experience to avoid this undesired behavior DO NOT create the resolver from the data source, create it from the appsync api.
https://docs.aws.amazon.com/cdk/api/latest/docs/@aws-cdk_aws-appsync.GraphqlApi.html#createwbrresolverpropsspan-classapi-icon-api-icon-experimental-titlethis-api-element-is-experimental-it-may-change-without-noticespan
https://docs.aws.amazon.com/cdk/api/latest/docs/@aws-cdk_aws-appsync.CfnResolver.html