-
Notifications
You must be signed in to change notification settings - Fork 819
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
Change data source for resolver that extends Amplify-generated one #9623
Comments
Hi @jk171505, you should be able to achieve what you need by using CDK to define custom VTL resolvers as described here: https://docs.amplify.aws/cli/graphql/custom-business-logic/#vtl-resolver. Please let us know if you still have any issues |
@lazpavel where do I define the exact slot for which I want to change the data source? |
Can I accomplish the same by defining the data source for specific slot in |
I see, the link above will allow you to create and configure a custom resolver and not to update a different data source for a slot on an extended resolver. For that you could use the documented way to extend a resolver (e.g:
|
Thanks! That's exactly what I needed. |
@lazpavel Is there a difference between the replacement of **ModelB** and **ModelATable** in your example? I'm confused by this, so if model A is named "Item" should **ModelATable** be "Item" or "ItemTable"? |
@Dennis-Dekker you are basically changing the dataSource for ModelB to ModelA. You should also add the suffix 'Table', so it should be:
|
This is my
On
Amplify version is Is what explained in this issue still valid? |
@ggorge-etiqa Did you ever solve this? I'm facing the same issue. |
Yes, this is still a valid solution with amplify cli v 12.11.1 For the function name you can also take a look into your build folder, where you can also find the generated resolvers. Here you can also find the CloudFormation stacks. Find the stack for your origin model. Find your function. The function should have this syntax: You need the FunctionName part und use it in override.ts: |
Which Category is your question related to?
api
Amplify CLI Version
7.6.8
Provide additional details e.g. code snippets
Is this possible to change data source for new resolver that extends Amplify-generated one in new version of graphQL transformer (V2)?
The text was updated successfully, but these errors were encountered: