Skip to content

__resolveType and __isTypeOf do not support Promise as return value #3549

@marcoreni

Description

@marcoreni

Describe the bug
GraphQL supports returning promise for __resolveType and __isTypeOf (for interfaces and unions) since graphql/graphql-js#631, but code generator does not support it.

  1. My GraphQL schema:
interface Item {
}
  1. My codegen.yml config file:
overwrite: true
schema: "./schemas/schema.gql"
documents: null

generates:
  src/types.ts:
    plugins:
      - "typescript"
      - "typescript-resolvers"
    config:
      useIndexSignature: true

Expected behavior
Generated code for TypeResolveFn and isTypeOfResolverFn should include the Promise as a result, similar to what it's done for ResolverFn.

Metadata

Metadata

Assignees

Labels

pluginswaiting-for-releaseFixed/resolved, and waiting for the next stable release

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions