amplify-codegen
amplify-codegen copied to clipboard
Amplify codegen doesn't support namespace queries/mutations
How did you install the Amplify CLI?
npm
If applicable, what version of Node.js are you using?
v20.10.0
Amplify CLI Version
12.8.2
What operating system are you using?
Mac (also with devcontainers Debian 11 bullseye)
Did you make any manual changes to the cloud resources managed by Amplify? Please describe the changes made.
N/A
Describe the bug
Hi, my schema has namespaced queries/mutations and when running amplify codegen
it's failing when trying to generate types. The following repo https://github.com/sescotti/amplify-namespaced-gql reproduces the issue.
I'm getting the following error:
node ➜ /workspaces/namespaced-graphql (master) $ amplify codegen
✔ Generated GraphQL operations successfully and saved at src/graphql
⠋ Generating.../GraphQL request: Field "create" argument "input" of type "CreateCustomerInput!" is required, but it was not provided.
.../GraphQL request: Field "create" argument "input" of type "CreateOrderInput!" is required, but it was not provided.
.../GraphQL request: There can be only one operation named "Customer".
.../GraphQL request: There can be only one operation named "Customer".
.../GraphQL request: Field "get" argument "id" of type "ID!" is required, but it was not provided.
.../GraphQL request: There can be only one operation named "Order".
.../GraphQL request: There can be only one operation named "Order".
.../GraphQL request: Field "get" argument "id" of type "ID!" is required, but it was not provided.
✖ Validation of GraphQL query document failed
Expected behavior
GQL types correctly generated
Reproduction steps
- (Optional) Open repo in devcontainer
- Run
amplify codegen
Project Identifier
Learn more at https://docs.amplify.aws/cli/reference/diagnose/ ⠋ Creating Zip No Amplify backend project files detected within this folder. ✖ Creating Zip
Log output
# Put your logs below this line
Additional information
Same thing happens when collecting the schema from an existing AppSync API when using the --apiId
arg
Before submitting, please confirm:
- [X] I have done my best to include a minimal, self-contained set of instructions for consistently reproducing the issue.
- [X] I have removed any sensitive information from my code snippets and submission.
Hey, 👋 thanks for raising this! I'm going to transfer this over to our codegen repository for better assistance 🙂.
hi @ykethan! could you provide a link to follow this on the other repo? thanks!
Hi @sescotti, the issue was transferred from amplify-cli to amplify-codegen. The same thread is preserved when an issue is transferred (a new ticket is not created).