graphql-code-generator: Unable to find template plugin matching typescript-operations
Describe the bug New Angular Cli project Run npm init run standard install
To Reproduce Steps to reproduce the behavior:
- My GraphQL schema:
- too big
- My GraphQL operations:
graphql-codegen init
graphql-codegen --config codegen.yml
- My
codegen.ymlconfig file:
overwrite: true
schema: "http://apollot:8972/samples/graphql/service"
documents: "src/**/*.graphql"
generates:
src/generated/graphql.ts:
plugins:
- "typescript"
- "typescript-operations"
- "typescript-apollo-angular"
- "typescript-graphql-files-modules"
Expected behavior Standard generate result
Environment: “@graphql-codegen/typescript”: “1.3.0”, “@graphql-codegen/typescript-apollo-angular”: “1.3.0”, “@graphql-codegen/typescript-graphql-files-modules”: “1.3.0”, “@graphql-codegen/typescript-operations”: “1.3.0”,
Global cli package @graphql-codegen/cli 1.3.0
- OS: Windows 10
@graphql-codegen/...:- NodeJS: 8.9.3
Additional context

About this issue
- Original URL
- State: closed
- Created 5 years ago
- Comments: 17 (6 by maintainers)
Hi @warrendodsworth ! Are you sure all dependencies are installed correctly? Did you ran
yarnornpm installafter adding the plugins topackage.json? Can you please try to create a small reproduction in a repository?Hi @warrendodsworth , I noticed the following in your repo:
@graphql-codegen/cli.typescript-graphql-files-modulesrequires extensionsd.tsso I recommend using it separately.fragment-matcheris better used in a separate file.You config should look like that:
I couldn’t reproduce your issue with the reproduction repo. Tried with Node 10 and NPM (tried to install dependencies using
yarn installandnpm install) - it worked for me.I encountered the same error and the reason was that I had both the new
graphql-codegennamespaced packages, and the old ones (graphql-code-generator<-packageName>), resulting in a conflict:Removing the old ones solved it !
I also had this issue. Re-installing @graphql-codegen/typescript after i had installed the apollo plugin fixed it.
The issue for me is the
initcommand added 3 packages which version is ‘0.0.0’, updated the fields solved it,I had this problem, and it was caused by running wrong script. I ran
yarn gql-geninstead of newyarn graphql-codegenHi @dotansimha, Thanks for getting back to me so quickly mate Yes, I did run npm i after adding the plugins using graphql-codegen init
I’ve created a small repo to reproduce the issue https://github.com/warrendodsworth/web-graphql-codegen-reproduce-bug