Describe the bug
Specifying apolloClientVersion as integer for fragment-matcher results in error Extension .ts not supported because strict match against string is used at https://github.com/dotansimha/graphql-code-generator/blob/master/packages/plugins/other/fragment-matcher/src/index.ts#L134
In docs it is specified as integer: https://graphql-code-generator.com/docs/plugins/fragment-matcher#apolloclientversion-string-default-value-2
To Reproduce
Steps to reproduce the behavior:
overwrite: true
schema: './schema/index.ts'
documents: './graphql/**/*.graphql'
generates:
'./graphql/__generated__/introspectionResult.ts':
hooks:
afterOneFileWrite:
- prettier --write
config:
apolloClientVersion: 2
plugins:
- fragment-matcher
try to generate schema, you will get Extension .ts not supported.
Then change configuration to
overwrite: true
schema: './schema/index.ts'
documents: './graphql/**/*.graphql'
generates:
'./graphql/__generated__/introspectionResult.ts':
hooks:
afterOneFileWrite:
- prettier --write
config:
apolloClientVersion: '2'
plugins:
- fragment-matcher
Environment:
@graphql-codegen/[email protected]: You are right, we should allow more loose type checking for that values because it's coming from the YAML config.
I changed it in: https://github.com/dotansimha/graphql-code-generator/pull/3495
Now both string/number will work .
Can you please try the alpha version? 1.12.3-alpha-1823fb22.25
@dotansimha I tried the version you mentioned and it works OK. 馃憤 Thank you. I'm sorry I didn't provide a PR. I was in a hurry :(
Fixed in v1.13.0