Describe the bug
@graphql-codegen/typescript-react-apollo doesn't respect capitalized type prefixes anymore since 1.8.2. This results in a mismatch with the other 1.8.2 plugins that do properly implement capitalized type prefixes.
To Reproduce
Install @graphql-codegen/[email protected] and generate a hook with typesPrefix set to GQL. Results in:
return ApolloReactHooks.useQuery<GqlMyQuery.
instead of the expected:
return ApolloReactHooks.useQuery<GQLMyQuery.
My codegen.yml config file:
schema:
- schema-location
documents: "./src/**/*.graphql"
overwrite: true
generates:
./.generated/fragmentTypes.json:
plugins:
- fragment-matcher
./.generated/gql.model.tsx:
plugins:
- typescript
- typescript-operations
- typescript-react-apollo
config:
scalars:
Time: string
withHooks: true
withHOC: false
hooksImportFrom: "@apollo/react-hooks"
avoidOptionals: true
typesPrefix: GQL
./.generated/schema.graphql:
- schema-ast
Expected behavior
All plugins should implement the typesPrefix config the same way.
Environment:
@graphql-codegen/typescript-react-apollo: 1.8.2Another issues related to 1.8.2 #2742
I think I managed to reproduce and fix this in: https://github.com/dotansimha/graphql-code-generator/pull/2862
@Rachnerd @xiaoyu-tamu Can you please try this alpha? 1.8.3-alpha-57c54418.34
@dotansimha 1.8.3-alpha-57c54418.34 fixes the issue. Thanks!
@dotansimha it works. Thank you!
Fixed in 1.8.3