dotansimha/graphql-code-generator
View on GitHubset typesPrefix with enumPrefix doesn't work with typescript-resolvers
Open
#4,249 opened on Jun 17, 2020
corehelp wantedpluginsstage/1-reproduction
Description
Describe the bug
When enumPrefix is set to false typescript-resolver doesn't use prefixed type name even if typesPrefix is set to T.
To Reproduce Steps to reproduce the behavior:
- set enumPrefix to
false - set typesPrefix to
T - graphql-codegen
Here is codesandbox.
https://codesandbox.io/s/quirky-proskuriakova-yyexo?file=/types.ts
- My GraphQL schema:
# Put your schema here
type Query {
user(id: ID!): User!
}
type User {
id: ID!
username: String!
email: String!
}
- My GraphQL operations: (Not related to this issue)
query user {
user(id: 1) {
id
username
email
}
}
# Put your operations here
- My
codegen.ymlconfig file:
schema: schema.graphql
documents: document.graphql
generates:
types.ts:
config:
typesPrefix: T
enumPrefix: false
plugins:
- typescript
- typescript-operations
- typescript-resolvers
# Put your YML here
Expected behavior
generated resolver type should use prefixed type.
Environment:
- OS: macOS 10.15.4 catalina
- "@graphql-codegen/cli": "^1.15.3",
- "@graphql-codegen/typescript": "^1.15.3",
- "@graphql-codegen/typescript-resolvers": "^1.15.3"
- NodeJS: v10.20.1
Additional context