Skip to content

Type incompatibility with graphql v16.12.0: Missing Kind enum values (..._COORDINATE) #64

@LouisLec

Description

@LouisLec

Describe the bug

Describe the bug

When using gql.tada with graphql v16.12.0, TypeScript reports type errors due to missing Kind enum values in @0no-co/graphql.web that were added in graphql v16.12.0.

Image

Environment

  • graphql: 16.12.0
  • gql.tada: 1.9.0
  • TypeScript: 5.9.3

Error message

Argument of type 'TadaDocumentNode<{ users: { id: string; name: string; email: string; }[]; }, {}, void>' is not assignable to parameter of type 'DocumentNodeLike'.
  Types of property 'kind' are incompatible.
    Type 'import("/graphql-web-kind-repro/node_modules/.pnpm/graphql@16.12.0/node_modules/graphql/language/kinds").Kind.DOCUMENT' is not assignable to type 'import("/graphql-web-kind-repro/node_modules/.pnpm/@0no-co+graphql.web@1.2.0_graphql@16.12.0/node_modules/@0no-co/graphql.web/dist/graphql.web").Kind.DOCUMENT'.
      Property 'TYPE_COORDINATE' is missing in type 'import("/graphql-web-kind-repro/node_modules/.pnpm/@0no-co+graphql.web@1.2.0_graphql@16.12.0/node_modules/@0no-co/graphql.web/dist/graphql.web").Kind'.ts(2345)

Root cause

graphql v16.12.0 added new Kind enum values that are not present in @0no-co/graphql.web: https://github.com/graphql/graphql-js/pull/4493/files

This causes TypeScript to consider the two Kind enums as incompatible types.

Workaround

I had to downgrade graphql to 16.11.0

Do you want me to open a new PR completing the Kind enum ?

Reproduction

https://github.com/LouisLec/graphql-web-kind-repro

Package version

"gql.tada": "^1.9.0",
"graphql": "^16.12.0"

Validations

  • I can confirm that this is a bug report, and not a feature request, RFC, question, or discussion, for which GitHub Discussions should be used
  • Follow our Code of Conduct

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions