Skip to content

PR #3893 seems to break compatibility with @graphql-typed-document-node/core #3897

Description

@nborko

Describe the bug

Using the latest 6.0.3 version of @urql/core:

I'm using graphql-codegen to generate document types, which uses @graphql-typed-document-node/core@^3.2.0. When using the latest version of @urql/core (via @urql/vue), with exactOptionalProperties enabled in tsconfig, I get (e.g. in useMutation):

TS2345: Argument of type 'TypedDocumentNode<DocType, Exact<{ input: InputType; }>>' is not assignable to parameter of type 'DocumentInput<DocType, Exact<{ input: InputType; }>>'.
...
    Type 'TypedDocumentNode<DocType, Exact<{ input: InputType; }>>' is not assignable to type '{ readonly tokenCount?: number; }' with 'exactOptionalPropertyTypes: true'.
Consider adding 'undefined' to the types of the target's properties.
      Types of property 'tokenCount' are incompatible.
        Type 'number | undefined' is not assignable to type 'number'.
          Type 'undefined' is not assignable to type 'number'.

Downgrading to 6.0.2 works.

Reproduction

See above.

Urql version

@urql/core@6.0.3

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
  • Read the docs.
  • 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