-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Closed
Labels
stage/4-pull-requestA pull request has been opened that aims to solve the issueA pull request has been opened that aims to solve the issuestage/5-alpha-release-testingThe pull request is merged, an alpha release is available, to be testedThe pull request is merged, an alpha release is available, to be tested
Description
Describe the bug
The enumPrefix = false config setting is stripping the prefix from non-enum types in IResolversTypes
and IResolversParentTypes
.
To Reproduce
Steps to reproduce the behavior:
https://codesandbox.io/s/quirky-proskuriakova-vmpz0v?file=/types.ts
- My GraphQL schema:
type Query {
user: User!
}
type User {
name: String!
}
- My GraphQL operations:
None
- My
codegen.yml
config file:
schema: schema.graphql
generates:
types.ts:
plugins:
- typescript
- typescript-resolvers
config:
typesPrefix: I
enumPrefix: false
Expected behavior
Only skip the type prefix for enum types. The type for User
should match the generated type IUser
.
export type IResolversParentTypes = {
Boolean: Scalars['Boolean'];
Query: {};
String: Scalars['String'];
User: IUser;
};
Instead of:
export type IResolversParentTypes = {
Boolean: Scalars['Boolean'];
Query: {};
String: Scalars['String'];
User: User;
};
Environment:
https://codesandbox.io/s/quirky-proskuriakova-vmpz0v?file=/types.ts
"@graphql-codegen/add": "^3.1.1",
"@graphql-codegen/cli": "^2.4.0",
"@graphql-codegen/typescript": "2.4.5",
"@graphql-codegen/typescript-resolvers": "2.5.2",
"graphql": "^16.2.0"
Additional context
Also happens with typesSuffix
set and using {T}
in defaultMapper
.
Metadata
Metadata
Assignees
Labels
stage/4-pull-requestA pull request has been opened that aims to solve the issueA pull request has been opened that aims to solve the issuestage/5-alpha-release-testingThe pull request is merged, an alpha release is available, to be testedThe pull request is merged, an alpha release is available, to be tested