https://serverless-stack.com/ logo
#sst
Title
# sst
m

Mike McCall

04/12/2021, 10:49 PM
It looks like when updating the resolver data source in the appsync construct you have to remove it, deploy, add it back, and redeploy. Changing the data source does not result in an update.
f

Frank

04/12/2021, 11:40 PM
Oh I see. Do you have a snippet of what it was set to before and after?
m

Mike McCall

04/13/2021, 2:07 PM
Hey sorry for the late reply. It’s going from lambda resolver to vtl
From
Copy code
"Query license": "mainDS",
To:
Copy code
"Query license":  {
                dataSource: "dynamoDS",
                resolverProps: {
                    requestMappingTemplate: MappingTemplate.fromFile("src/mapping-templates/Query.license.req.vtl"),
                    responseMappingTemplate: MappingTemplate.fromString("$utils.toJson($context.result)")
                }
            }
f

Frank

04/13/2021, 5:52 PM
Thanks man! Was tied up yesterday with the Python release. I’m going to take a look at this today.
m

Mike McCall

04/13/2021, 8:47 PM
Np. Thanks
f

Frank

04/14/2021, 6:27 AM
Hey @Mike McCall, I had a chance to dig into this. It seems to be a known AppSync/Amplify issue. Here’s a link to the discussion - https://github.com/aws/aws-cdk/issues/13269
Apparently this issue has been around for years?! Removing and recreating the GraphQL API works, but that doesn’t make sense for production usage. The Amplify community seems to suggest this workaround - https://github.com/aws-amplify/amplify-cli/issues/682
m

Mike McCall

04/14/2021, 10:01 PM
Thanks @Frank
@Frank I did end up finding a fix for this. https://github.com/serverless-stack/serverless-stack/pull/418
f

Frank

06/08/2021, 6:08 PM
Oh nice! I’m going to cut a release with this today.
Released this in v0.26.0
Thanks again for looking into this!
m

Mike McCall

06/11/2021, 4:47 AM
Excellent. thank you!
3 Views