- Newest
- Most votes
- Most comments
I made it go!!
For anyone with a similar problem who lands here after a search, this explains the issue:
MrArnoldPalmer commented on Feb 24, 2021
Hey there, so this is a result of the fix we did for #12635. There seems to be an issue with AppSync in CFN where ordering of delete/create operations causes duplicates to occur when replacing existing resolvers. I created this issue to track that: #13269
Right now they only workaround is to remove the resolver resources, deploy that to the stack, then add them back and redeploy. If you want to avoid downtime, you can spin up a parallel instance of the GraphqlAPI construct in a new stack, point your clients to that, and then remove the old one.
https://github.com/aws/aws-cdk/issues/13238#issuecomment-785380708
Apparently, the @model(mutations: { create: null })
adjustment to the model, and the new create
mutation that I want to add, can't be deployed at the same time. I had to first remove the default resolver and deploy that with the new parameters on the @model
. Then I could successfully add the new Lambda functiuon resolver using @function
.
I had to comment out the custom mutator that I was trying to overwrite:
// type Mutation {
// createExternalAPISession(username: String, password: String): ExternalAPISession @function(name: "CreateExternalAPISession-${env}")
// }
I deployed the schema with amplify push
, including the @model(mutations: { create: null })
. Then un-commented my new mutator and deployed again with another amplify push
. Success.
If you found your way here after searching, then you might also be interested in learning how to locate the DynamoDB table that AppSync created for your @model
in your GraphQL schema. Overriding the CRUD operation is one thing, but once you can do that you will still need to access the underlying storage.
If you're faced with that challenge, then please take a look at the "How to pass stack outputs from app resources into function stack parameters" header in another one of my questions that I ended up answering by myself: https://repost.aws/questions/QUzLTfzx-mQmS15VMFVZBdDw/how-to-pass-the-amplify-app-id-to-a-function-how-to-do-app-introspection-from-backend-functions
Relevant content
- asked a year ago
- Accepted Answerasked 3 years ago
- AWS OFFICIALUpdated 2 years ago
- AWS OFFICIALUpdated 2 years ago
- AWS OFFICIALUpdated 2 years ago
- AWS OFFICIALUpdated a day ago