graphql-code-generator: Unable to find template plugin matching 'typescript-operations'
Can’t run graphql-codegen due to typescript-operations and introspection despite them being in devDependencies of package.json.
graphql-codegen
✔ Parse configuration
❯ Generate outputs
❯ Generate interfaces/sdk.ts
✔ Load GraphQL schemas
✔ Load GraphQL documents
✖ Generate
→ Unable to find template plugin matching typescript-operations
❯ Generate ./graphql.schema.json
✔ Load GraphQL schemas
✔ Load GraphQL documents
✖ Generate
→ Unable to find template plugin matching introspection
Found 2 errors
✖ ./graphql.schema.json
Unable to find template plugin matching 'introspection'
Install one of the following packages:
- @graphql-codegen/introspection
- @graphql-codegen/introspection-template
- @graphql-codegen/introspection-plugin
- graphql-codegen-introspection
- graphql-codegen-introspection-template
- graphql-codegen-introspection-plugin
- codegen-introspection
- codegen-introspection-template
- introspection
✖ interfaces/sdk.ts
Unable to find template plugin matching 'typescript-operations'
Install one of the following packages:
- @graphql-codegen/typescript-operations
- @graphql-codegen/typescript-operations-template
- @graphql-codegen/typescript-operations-plugin
- graphql-codegen-typescript-operations
- graphql-codegen-typescript-operations-template
- graphql-codegen-typescript-operations-plugin
- codegen-typescript-operations
- codegen-typescript-operations-template
- typescript-operations
To Reproduce Steps to reproduce the behavior: graphql-codegen init yarn gql
I’ve tried
rm -rf node_modules and reinstalling, no difference.
package.json “gql”: “graphql-codegen --config codegen.yml”,
“devDependencies”: { “@graphql-codegen/cli”: “^1.13.1”, “@graphql-codegen/introspection”: “^1.13.1”, “@graphql-codegen/typescript”: “^1.13.1”, “@graphql-codegen/typescript-graphql-files-modules”: “1.3.1”, “@graphql-codegen/typescript-graphql-request”: “1.13.1”, “@graphql-codegen/typescript-operations”: “1.3.1”, “typescript”: “^3.8.3”
codegen.yml
overwrite: true
schema:
- https://*.:
headers:
Authorization: Bearer *
documents: "interfaces/**/*.graphql"
generates:
interfaces/sdk.ts:
plugins:
- "typescript"
- "typescript-operations"
- "typescript-graphql-files-modules"
./graphql.schema.json:
plugins:
- "introspection"
Environment:
- OS:
- NodeJS: 12.16.1
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Comments: 15 (4 by maintainers)
There is a version mismatch in your package.json file. So could you update it like below; Please avoid using
^in package.json.I tried that, and deleting package lock. same issue. I was at it for 2 hours trying every possible thing in different combination, and had to give up. It’s literally a blank slate project.
Hi Ethan The solution was to delete the node_module folder and re-install it.
@Lopliok Make sure package is installed. If you are in a monorepo env, make sure codegen cli,core and plugins are on the same level.