Skip to content
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

Amplify codegen doesn't support namespace queries/mutations #776

Open
2 tasks done
sescotti opened this issue Dec 24, 2023 · 3 comments
Open
2 tasks done

Amplify codegen doesn't support namespace queries/mutations #776

sescotti opened this issue Dec 24, 2023 · 3 comments
Labels
feature-request New feature or request transferred Issue has been transferred from another Amplify repository

Comments

@sescotti
Copy link

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

  1. (Optional) Open repo in devcontainer
  2. 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:

  • I have done my best to include a minimal, self-contained set of instructions for consistently reproducing the issue.
  • I have removed any sensitive information from my code snippets and submission.
@sescotti sescotti added the pending-triage Issues that need further discussion to determine label Dec 24, 2023
@ykethan
Copy link
Member

ykethan commented Dec 27, 2023

Hey, 👋 thanks for raising this! I'm going to transfer this over to our codegen repository for better assistance 🙂.

@ykethan ykethan transferred this issue from aws-amplify/amplify-cli Dec 27, 2023
@ykethan ykethan added the transferred Issue has been transferred from another Amplify repository label Dec 27, 2023
@sescotti
Copy link
Author

hi @ykethan! could you provide a link to follow this on the other repo? thanks!

@dpilch
Copy link
Member

dpilch commented Jan 9, 2024

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).

@dpilch dpilch added feature-request New feature or request and removed pending-triage Issues that need further discussion to determine labels Jan 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature-request New feature or request transferred Issue has been transferred from another Amplify repository
Projects
None yet
Development

No branches or pull requests

3 participants