Open Dennis-Dekker opened 7 months ago
Hey, 👋 thanks for raising this! I'm going to transfer this over to our API repository for better assistance 🙂
+1
Would be very very helpful!
+1
Hi, is there any update on this issue? Or does someone have some pointers towards using JS resolvers?
Amplify CLI Version
12.10.1
Question
To enhance the flexibility of Appsync, we are investigating the migration from VTL resolvers to JS resolvers. Despite consulting the documentation for instructions, the implementation process remains unclear. My current approach involves using the custom resource feature of the Amplify CLI to substitute VTL resolvers with JS resolvers. This, however, has presented several challenges.
A primary concern is the limitation imposed by the Code.fromInline function, which constrains the scalability of our JS resolvers. An alternative method that avoids the necessity of embedding extensive code within multiline strings in a single file would be helpful.
The main objective is to replace auto-generated VTL resolvers with JS ones. My initial strategy was to use the CDK stack to create new JS resolvers, naming them identically to their VTL counterparts. This resulted in an error indicating that a resolver for the query/mutation already exists. Altering the approach by preventing Amplify from generating resolvers using "@model(queries: { get: null }, mutations: null, subscriptions: null)" and then adding the resolver led to an error stating "The query/mutation does not exist."
A concise guide on employing JS resolvers within Amplify, particularly for replacing generated ones, would be highly valuable. Additionally, I am interested in understanding Amplify's future plans regarding these updates. The Appsync documentation now primarily supports the APPSYNC_JS runtime, as stated on their page. I am eager to know when this will be integrated into Amplify. Thank you for your attention to this matter.