-
Notifications
You must be signed in to change notification settings - Fork 70
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Overwrite data source of Amplify-generated resolvers #69
Comments
Hi @zirkelc this currently isn't possible but could be a feature we would implement. Can you describe more about your use case for changing the data source to lambda? |
Hi @edwardfoyle for a detailed use case I will link you to my comment on another issue: #430 AppSync Pipeline resolvers and the ability to override and extend resolvers is great idea in general. However, due to the fact that an overriden resolver is always being generated with I created this issue hoping that there are any workarounds to change the DataSource on the generated CloudFormation template somehow. |
Are there any updates wrt the timeline for this feature? I filed a related issue and was referred to this one. The solution proposed in #430, "make the top line of the resolver file define the data source" seems reasonable. |
The solution proposed here aws-amplify/amplify-cli#9623 (comment), which involves using override.ts to manually set the value of models.{ModelName}.appsyncFunctions.{ResolverName}.dataSourceName solved this for me. |
I want extend the the Amplify generated resolver
Mutation.createOrgnaization
for the modelOrganization
with some custom logic. I followed the official documentation and added two resolver templatesMutation.createOrganization.postUpdate.1.req.vtl
andMutation.createOrganization.postUpdate.1.res.vtl
. These resolvers get picked up by Amplify and added into the final pipeline resolver aspostUpdate
resolver.The problem is that the
postUpdate
resolver is created with data sourceNONE
. However, I want to invoke a Lambda function so I need to change the data source to another value. I can change the data source via the AppSync Console, but every push overwrites it again. I tried to use theCustomResources.json
file to change the definition ofpostUpdate
resolver, but instead it creates a second resolver with the same name.Is there any way to overwrite the data source of these resolver templates?
CustomResources.json
Which Category is your question related to?
API (GraphQL) with GraphQL Transformer v2
Amplify CLI Version
7.6.22
You can use
amplify -v
to check the amplify cli version on your systemWhat AWS Services are you utilizing?
AWS AppSync
Provide additional details e.g. code snippets. Be sure to remove any sensitive data.
The text was updated successfully, but these errors were encountered: