Type alias TypedDocumentNode<Result, Variables>

TypedDocumentNode<Result, Variables>: DocumentNode & {
    __apiType?: ((variables) => Result);
    __ensureTypesOfVariablesAndResultMatching?: ((variables) => Result);
}

A GraphQL DocumentNode with attached generics for its result data and variables.

Remarks

A GraphQL DocumentNode defines both the variables it accepts on request and the data shape it delivers on a response in the GraphQL query language.

To bridge the gap to TypeScript, tools may be used to generate TypeScript types that define the shape of data and variables ahead of time. These types are then attached to GraphQL documents using this TypedDocumentNode type.

Using a DocumentNode that is typed like this will cause any urql API to type its input variables and resulting data using the types provided.

See

https://github.com/dotansimha/graphql-typed-document-node for more information.

Type Parameters

  • Result = {
        [key: string]: any;
    }

  • Variables = {
        [key: string]: any;
    }

Generated using TypeDoc