In v1.0.0, fragment-matcher errors where in 0.18.0 it was working:
codegen.yml (snippet)
ui/src/graphql/fragments.tsx:
documents: ui/src/**/*.graphql
plugins:
- fragment-matcher
package.json
"@graphql-codegen/cli": "^1.0.0",
"@graphql-codegen/fragment-matcher": "^1.0.0",
"@graphql-codegen/typescript": "^1.0.0",
"@graphql-codegen/typescript-operations": "^1.0.0",
"@graphql-codegen/typescript-react-apollo": "^1.0.0",
Error:
✖ ui/src/graphql/fragments.tsx
Unable to load template plugin matching 'fragment-matcher'.
Reason:
Unexpected token {
Same issue here. The package.json for this plugin points to an es modules build with it's main field.
Compare the typescript plugin with the fragment-matcher plugin
I'm working on a PR now.
Fixed in 1.0.1 🚀
I am trying to generate C# classes for GraphQL. I am getting "fragment-matcher" validation failed error as below.
npm run csharp
@ csharp C:\Users\Sathiyapriya
graphql-codegen --config wingcode.yml
√ Parse configuration
Generate outputs
Generate\Output\winggraph.cs
√ Load GraphQL schemas
√ Load GraphQL documents
× Generate
→ Plugin "fragment-matcher" validation failed:
√ Generate ./graphql.schema.json
Please help.
@sathiyapriyababu Could you pleass open a seperate issue with a clear minimal reproduction?