0

I'm following this.

I installed @graphql-codegen/cli as a Dev dependency here is my package.json.

{

  "dependencies": {
    "@apollo/client": "^3.4.8",
    "graphql": "^15.5.1",
    "next": "11.1.0",
    "react": "17.0.2",
    "react-dom": "17.0.2"
  },
  "devDependencies": {
    "@graphql-codegen/cli": "^2.1.1",
    "@graphql-codegen/typescript-react-apollo": "^3.1.0",
    "@types/react": "^17.0.18",
    "eslint": "7.32.0",
    "eslint-config-next": "11.1.0",
    "graphql-codegen": "^0.4.0",
    "typescript": "^4.3.5"
  }
}

When i run:

yarn graphql-codegen init

I'm getting this error:

...
Error: Unknown argument: init
...

Can someone tell me what's wrong here!

crispengari
  • 7,901
  • 7
  • 45
  • 53
  • Did you find a solution to this? – IgnisDa Dec 25 '21 at 02:53
  • yes you can run `npx graphql-codegen init` or uninstall `graphql-codegen` and re install it – crispengari Dec 26 '21 at 14:18
  • 1
    `@graphql-codegen/cli` and `graphql-codegen` both supply the `graphql-codegen` binary. If you're getting the above error, you probably don't need `graphql-codegen` installed. Remove it from your `package.json` and reinstall the `node_modules`. – IgnisDa Dec 27 '21 at 04:19

0 Answers0