Mirror: The highly customizable and versatile GraphQL client with which you add on features like normalized caching as you grow.
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

feat(core): Add support for graphql.js’ built-in TypedQueryDocumentNode (#3085)

authored by

Phil Pluckthun and committed by
GitHub
087339b8 3e0f34a9

+13 -2
+5
.changeset/hungry-panthers-fly.md
··· 1 + --- 2 + '@urql/core': patch 3 + --- 4 + 5 + Add support for `graphql`’s built-in `TypedQueryDocumentNode` typings for type inference.
+8 -2
packages/core/src/types.ts
··· 1 - import type { GraphQLError, DocumentNode } from 'graphql'; 1 + import type { GraphQLError, DocumentNode, DefinitionNode } from 'graphql'; 2 2 import { Subscription, Source } from 'wonka'; 3 3 import { Client } from './client'; 4 4 import { CombinedError } from './utils/error'; ··· 26 26 Result = { [key: string]: any }, 27 27 Variables = { [key: string]: any } 28 28 > extends DocumentNode { 29 - /** Type to check whether `Variables` and `Result` are assignable types. 29 + /** GraphQL.js Definition Nodes of the `DocumentNode`. */ 30 + readonly definitions: ReadonlyArray<DefinitionNode>; 31 + /** Type to support `@graphql-typed-document-node/core` 30 32 * @internal 31 33 */ 32 34 __apiType?: (variables: Variables) => Result; 35 + /** Type to support `TypedQueryDocumentNode` from `graphql` 36 + * @internal 37 + */ 38 + __ensureTypesOfVariablesAndResultMatching?: (variables: Variables) => Result; 33 39 } 34 40 35 41 /** A list of errors on {@link ExecutionResult | ExecutionResults}.