UNPKG

801 BTypeScriptView Raw
1import type { DocumentNode, ExecutableDefinitionNode } from '../language/ast';
2/**
3 * Wrapper type that contains DocumentNode and types that can be deduced from it.
4 */
5export interface TypedQueryDocumentNode<
6 TResponseData = {
7 [key: string]: any;
8 },
9 TRequestVariables = {
10 [key: string]: any;
11 },
12> extends DocumentNode {
13 readonly definitions: ReadonlyArray<ExecutableDefinitionNode>;
14 /**
15 * This type is used to ensure that the variables you pass in to the query are assignable to Variables
16 * and that the Result is assignable to whatever you pass your result to. The method is never actually
17 * implemented, but the type is valid because we list it as optional
18 */
19 __ensureTypesOfVariablesAndResultMatching?: (
20 variables: TRequestVariables,
21 ) => TResponseData;
22}