Search code examples
graphql-codegen

Graphql Codegen Wizard Terminated Unexpected


I am trying to use the GraphQL Codegen Wizard for my application. I followed the installation instruction from this site: https://www.graphql-code-generator.com/docs/getting-started/installation

All the dependencies are successfully installed via npm with --legacy-peer-deps due to conflict. When the time to run this command below, the script ended unexpectedly. I did not get a chance to answer the question.

npx graphql-codegen init

enter image description here

what am I doing wrong?

System Details:

  • OS Windows 10
  • Node 16.15.1
  • npm 8.11.0
  • yarn 1.22.19
  • Angular CLI 14.0.1
  • GraphQL ^16

Solution

  • The only fix that I've come up with is downgrading to version 2.10.0 of graphql code generator.

    In your package.json make this change -> "@graphql-codegen/cli": "2.10.0"

    then npm install