Extended 'Query' type does not carry over auth directives #3036
Labels
api-graphql
bug
Something isn't working
pending-community-response
Issue is pending a response from the author or community.
How did you install the Amplify CLI?
npm
If applicable, what version of Node.js are you using?
22.8
Amplify CLI Version
12.11.1
What operating system are you using?
Mac
Did you make any manual changes to the cloud resources managed by Amplify? Please describe the changes made.
N/A
Describe the bug
When including multiple custom queries in split graphql schema files (following the guide here) the auth directives do not carry over into the generated
schema.graphql
file. This only occurs for the queries defined under theextend type Query { ... }
syntax. The queries defined intype Query { ... }
behave as expected.Expected behavior
I expect auth directives like
@aws_iam @aws_cognito_user_pools
to appear for all custom-queries configured with auth, regardless if they are declared under the base type or the extended type.Reproduction steps
schema
directory in a project with a graphql api.type Query { ... }
@auth(rules: [{ allow: private, provider: userPools }])
extend type Query { ... }
amplify build
schema.graphql
file that the auth directives are missing from the second custom query:Project Identifier
No response
Log output
Additional information
No response
Before submitting, please confirm:
The text was updated successfully, but these errors were encountered: