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 giving error -Invalid or incomplete schema, unknown type: AWSModelQueryMap. Ensure that a full introspection query is used in order to build a client schema. #14010

Closed
2 tasks done
BBopanna opened this issue Nov 9, 2024 · 11 comments
Labels
pending-triage Issue is pending triage

Comments

@BBopanna
Copy link

BBopanna commented Nov 9, 2024

How did you install the Amplify CLI?

npm

If applicable, what version of Node.js are you using?

v20.18.0

Amplify CLI Version

12.13.0

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.

NO

Describe the bug

amplify codegen is giving the below error from today for now reason - we did not change anything in our schema and yet this error and does NOT generate the models, queries, mutations etc

➜ amplify codegen
✔ Downloaded the schema
Invalid or incomplete schema, unknown type: AWSModelQueryMap. Ensure that a full introspection query is used in order to build a client schema.

Expected behavior

codegen should successfully generate models, queries, mutations

Reproduction steps

run the below command

amplify codegen

Project Identifier

No response

Log output

# Put your logs below this line


Additional information

No response

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.
@BBopanna BBopanna added the pending-triage Issue is pending triage label Nov 9, 2024
@ilfoxo
Copy link

ilfoxo commented Nov 10, 2024

Same for me!, i have many amplify projects. Today in one of them I ran "amplify codegen" and get the same error.

I tried with another project that i havent modified the code in many days (and was working) and got the same error.

Here my src/graphql/schema.json
schema.json

OS: Windows 11
Node: 20.12.2
Amplify: 12.13.0

@peimarAVL
Copy link

We also receive following error for node version v21.6.1 :

The command we are running is: npx @aws-amplify/cli codegen add --apiId XYX --region xx-central-x

"Invalid or incomplete schema, unknown type: AWSModelQueryMap. Ensure that a full introspection query is used in order to build a client schema."

@Dennis-Dekker
Copy link

same here

@FernandoI7
Copy link

Same here:

Node: 18.20.4
Amplify: 12.10.3

@FernandoI7
Copy link

This should be raised as critical, because is breaking all pipelines

@h4xmd
Copy link

h4xmd commented Nov 11, 2024

This has broken our Amplify pipelines as well. Suspicions are an updated 3rd party lib since it's happening across Amplify versions.

12.13.0 here Node 18.16.1

@h4xmd
Copy link

h4xmd commented Nov 12, 2024

This issue just resolved itself for me without any further changes/input.

@BBopanna
Copy link
Author

BBopanna commented Nov 12, 2024

These jokers at AWS - Amplify have the least professional etiquette IMHO as they simply dont care - when the entire community is hit by this error - no response yet.

This is what addressed for us - Credit to - Nishant B from internal developer support team who asked us to try these

amplify codegen remove
amplify codegen add
amplify codegen
amplify api gql-compile
amplify codegen

you will notice that below changes in .graphqlconfig.yml

 projects:
   wfGraphQLAPI:
-    schemaPath: src/graphql/schema.json
+    schemaPath: amplify/backend/api/wfGraphQLAPI/build/schema.graphql
     includes:
       - src/graphql/**/*.ts
     excludes:

AND

        codeGenTarget: typescript
        generatedFileName: src/API.ts
        docsFilePath: src/graphql
+        region: ap-south-1
+        apiId: null
        maxDepth: 3
extensions:
  amplify:

@phani-srikar
Copy link
Contributor

The fix has been deployed to impacted regions. Please try running the amplify codegen and share your region information if you are still facing this issue.

@ykethan
Copy link
Member

ykethan commented Nov 12, 2024

Closing the issue as a fix has been deployed and verified.

@ykethan ykethan closed this as not planned Won't fix, can't repro, duplicate, stale Nov 12, 2024
Copy link

This issue is now closed. Comments on closed issues are hard for our team to see.
If you need more assistance, please open a new issue that references this one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pending-triage Issue is pending triage
Projects
None yet
Development

No branches or pull requests

8 participants