aws / aws-cdk

The AWS Cloud Development Kit is a framework for defining cloud infrastructure in code
https://aws.amazon.com/cdk
Apache License 2.0
11.61k stars 3.91k forks source link

appsync: release 1.91.0 breaks appsync resolvers #13357

Closed smacintyre closed 3 years ago

smacintyre commented 3 years ago

Release 1.91.0 contains an breaking change for appsync revolvers and appears to make deploying unit resolvers impossible now. This was caused by the PR: #12973 -- this was not documented in the breaking changes section of the release notes.

Also the documentation is not up to date. According to the docs, if pipelineConfig is an empty array or undefined, a unit resolver is created. The change in #12973 breaks this.

Reverting to 1.90.1 doesn't fix the issue.

Reproduction Steps

   const data = graphqlApi.addDynamoDbDataSource('MainDataSource', table);

    data.createResolver({
      typeName: 'Mutation',
      fieldName: 'createVideo',
      requestMappingTemplate: MappingTemplate.fromFile(
        join(this.resolverDir, 'Mutation.createVideo.req.vtl')),
      responseMappingTemplate: MappingTemplate.dynamoDbResultItem(),
    });

What did you expect to happen?

To create a unit resolver -- this is what happened in prior versions.

What actually happened?

No resolver is created

Environment

Other

Right now, I have no idea of how to work around this.


This is :bug: Bug Report

cynicaljoy commented 3 years ago

seems to be a duplicate of #13269

MrArnoldPalmer commented 3 years ago

The issue re: resolvers is in #13269. This was fixing a previously breaking change @smacintyre, I'm sorry this wasn't explicitly called out in the changelog I should have required the breaking change annotation on the PR but made a mistake.

This issue stems from the cloudformation/appsync side unfortunately and we aren't quite sure how to handle it from the CDK side for both problems. IE only one resolver per field and/or the "successful" deploy of resolvers that aren't wired correctly. Experimentation and investigation is required and contributions are welcome on this front.

As for workarounds, @bigkraig talks about versioning resolvers in his app in #13269 and looks like some other workarounds are mentioned in this amplify issue. Worst case scenario deleting and recreating the GraphqlApi may be required.

@aws-cdk/aws-appsync L2 constructs are experimental and more breaking changes are expected, we will do our best to note these in the changelog but their usage in production workflows is not recommended without extreme caution. In addition the docs need a refresh in places, I created a separate issue to track a general revision. Closing this in favor of #13269 & #13502.

github-actions[bot] commented 3 years ago

⚠️COMMENT VISIBILITY WARNING⚠️

Comments on closed issues are hard for our team to see. If you need more assistance, please either tag a team member or open a new issue that references this one. If you wish to keep having a conversation with other community members under this issue feel free to do so.