Open michael-drury opened 3 years ago
You can overwrite the auto generated resolvers https://docs.amplify.aws/cli/graphql-transformer/resolvers
Thanks for the reply @UnleashedMind! I'm aware that I can customise the VTL, I'm just not sure how to change it in such a way that allows me to achieve the desired results.
Which Category is your question related to? GraphQL API
Amplify CLI Version 4.32.1
What AWS Services are you utilizing? AppSync, DynamoDb
Provide additional details e.g. code snippets
I have a nested GQL schema in the following style:
And am trying to use the use the following GQL mutation to update specific, individual nested values:
However, when I do this, all the other nested data stored of type 'bar' is removed. From my understanding, this is due to the way that amplify generates the VTL. I believe that the data is overwritten during this section:
As the key is being set to "bar" with the value as "{a:{d:1}}", as opposed to the key being "bar.a.d" and value being 1.
Is there a way to alter this behaviour so I can input new nested data, without overwriting any previously entered data?
For simplicity i'd rather keep just a VTL, instead of using a lambda resolver if possible.
The full auto-generated VTL is as follows: