aws-amplify / amplify-cli

The AWS Amplify CLI is a toolchain for simplifying serverless web and mobile development.
Apache License 2.0
2.82k stars 821 forks source link

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 BBopanna closed 1 day ago

BBopanna commented 4 days ago

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:

ilfoxo commented 3 days ago

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 commented 2 days ago

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 commented 2 days ago

same here

FernandoI7 commented 2 days ago

Same here:

Node: 18.20.4 Amplify: 12.10.3

FernandoI7 commented 2 days ago

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

h4xmd commented 2 days ago

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 commented 1 day ago

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

BBopanna commented 1 day ago

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 commented 1 day ago

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 commented 1 day ago

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

github-actions[bot] commented 1 day ago

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.