-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Open
Description
Which packages are impacted by your issue?
@graphql-codegen/typescript-resolvers
Describe the bug
The generated interface resolver base type includes only __resolveType attribute.
This behavior has a couple of problems:
- The resolver type derived from the base type is broken:
type ParentInterfaceResolvers = Pick<Types.ParentInterfaceResolvers, DefinedFields['ParentInterface']>;, asTypes.ParentInterfaceResolversgot no shared attributes withDefinedFields['ParentInterface'] - Cases where user wishes to create common resolvers shared by the types implementing the interface left unanswered, as
ParentInterfaceResolversis unusable and type-based resolvers usually has unshared attributes
Your Example Website or App
Steps to Reproduce the Bug or Issue
Set codegen to modules preset with 'typescript-resolvers- plugin. Then feed it with a simple schema which includes interface:
interface Plant {
id: ID!
species: String!
}
type Flower implements Plant {
id: ID!
species: String!
color: String!
}
type Tree implements Plant {
id: ID!
species: String!
height: Float!
}
Expected behavior
The interface resolver type will include all of it's shared attributes
Screenshots or Videos
No response
Platform
- OS: [e.g. macOS, Windows, Linux]
- NodeJS: [e.g. 18.5.0]
graphqlversion: [e.g. 16.3.0]@graphql-codegen/*version(s): [e.g. 2.6.2]
Codegen Config File
No response
Additional context
No response
Metadata
Metadata
Assignees
Labels
No labels