Closed kwhitejr closed 5 years ago
@kwhitejr You could use Custom resolvers to overwrite the auto-generated transformer resolvers. You can find more documentation out here - https://aws-amplify.github.io/docs/cli-toolchain/graphql#custom-resolvers Please feel free to re-open this issue if you're still stuck.
@kaustavghosh06 Hi Kaustav, thanks for the quick replay. I know about replacing resolvers, and usually I can get away with minor adjustments to the generated code. For the mutation update
resolver code, however, I'm a little overwhelmed, not sure where to start.
This issue has been automatically locked since there hasn't been any recent activity after it was closed. Please open a new issue for related bugs.
Looking for a help forum? We recommend joining the Amplify Community Discord server *-help
channels for those types of questions.
Which Category is your question related to? Api: Appsync generated code.
What AWS Services are you utilizing? Appsync
Provide additional details e.g. code snippets I simply want to modify certain generated resolvers (i.e.
Mutation.updateXYZ.req.vtl
) to support create-or-update, in order to cut down on have a bunch of conditional checks in front end code.In the most straightforward form of the issue, the update resolver requires an
id
field that does not yet exist. For example:Essentially I don't understand where in the generated updateXYZ vtl code to put a check for an
id
input + autoId if missing.