Open SteveJamesDev opened 2 years ago
Hey @SteveJamesDev :wave: thanks for raising this and for providing those details! I was able to successfully reproduce this issue using the following schema:
type Mutation {
doThing(input: String): Boolean
@function(name: "doThing-${env}")
@auth(rules: [{ allow: public }])
}
By including the at-auth directive, the CLI will generate the ...auth.req.vtl
resolver. Then when we create Mutation.doThing.auth.1.req.vtl
resolver and re-run amplify api gql-compile
we see the extended resolver is carried to build/resolvers
, however the stack is missing the mapping:
Marking as a bug 🙂
Any update on this? I'm facing similar issues. Custom ...auth.req.vtl resolvers are not included in the stack mapping and hence not being uploaded to the AppSync.
Is this feature request related to a new or existing Amplify category?
function, api
Is this related to another service?
No response
Describe the feature you'd like to request
Currently, the VTL templates for custom mutations do not allow the same extension capabilities as the @model based resolvers
https://docs.amplify.aws/cli/graphql/custom-business-logic/#override-amplify-generated-resolvers
For example, consider the following Mutations.graphql:-
If I create a Mutation.doThing.auth.1.req.vtl file and add it to my resolves directory ... it is ignored as part of the final AppSync deployment
My only option is to override the Mutation.doThing.auth.req.vtl
Describe the solution you'd like
I'd like custom Mutation/Query resolvers to be extendable in the same way as other resolvers outlined below
https://docs.amplify.aws/cli/graphql/custom-business-logic/#override-amplify-generated-resolvers
Describe alternatives you've considered
Only option is to Override (not extend)
Additional context
No response
Is this something that you'd be interested in working on?
Would this feature include a breaking change?