UNPKG

756 BTypeScriptView Raw
1import {
2 ASTNode,
3 TypeSystemDefinitionNode,
4 TypeSystemExtensionNode,
5 FragmentDefinitionNode,
6 OperationDefinitionNode
7} from "graphql";
8
9// FIXME: We should add proper type guards for these predicate functions
10// to `@types/graphql`.
11declare module "graphql/language/predicates" {
12 function isExecutableDefinitionNode(
13 node: ASTNode
14 ): node is OperationDefinitionNode | FragmentDefinitionNode;
15 function isTypeSystemDefinitionNode(
16 node: ASTNode
17 ): node is TypeSystemDefinitionNode;
18 function isTypeSystemExtensionNode(
19 node: ASTNode
20 ): node is TypeSystemExtensionNode;
21}
22
23declare module "graphql/validation/validate" {
24 interface ValidationContext {
25 _fragments: { [fragmentName: string]: FragmentDefinitionNode };
26 }
27}