UNPKG

2.49 kBTypeScriptView Raw
1import { Source } from '@graphql-tools/utils';
2import { Kind } from 'graphql';
3import { LoadTypedefsOptions, UnnormalizedTypeDefPointer } from './load-typedefs';
4declare type KindList = Array<typeof Kind[keyof typeof Kind]>;
5/**
6 * Kinds of AST nodes that are included in executable documents
7 */
8export declare const OPERATION_KINDS: KindList;
9/**
10 * Kinds of AST nodes that are included in type system definition documents
11 */
12export declare const NON_OPERATION_KINDS: ("InputObjectTypeExtension" | "Document" | "OperationDefinition" | "FragmentDefinition" | "SchemaDefinition" | "ScalarTypeDefinition" | "ObjectTypeDefinition" | "InterfaceTypeDefinition" | "UnionTypeDefinition" | "EnumTypeDefinition" | "InputObjectTypeDefinition" | "DirectiveDefinition" | "SchemaExtension" | "ScalarTypeExtension" | "ObjectTypeExtension" | "InterfaceTypeExtension" | "UnionTypeExtension" | "EnumTypeExtension" | "FieldDefinition" | "EnumValueDefinition" | "SelectionSet" | "Field" | "FragmentSpread" | "InlineFragment" | "Name" | "InputValueDefinition" | "VariableDefinition" | "Variable" | "Argument" | "IntValue" | "FloatValue" | "StringValue" | "BooleanValue" | "NullValue" | "EnumValue" | "ListValue" | "ObjectValue" | "ObjectField" | "Directive" | "NamedType" | "ListType" | "NonNullType" | "OperationTypeDefinition")[];
13/**
14 * Asynchronously loads executable documents (i.e. operations and fragments) from
15 * the provided pointers. The pointers may be individual files or a glob pattern.
16 * The files themselves may be `.graphql` files or `.js` and `.ts` (in which
17 * case they will be parsed using graphql-tag-pluck).
18 * @param pointerOrPointers Pointers to the files to load the documents from
19 * @param options Additional options
20 */
21export declare function loadDocuments(pointerOrPointers: UnnormalizedTypeDefPointer | UnnormalizedTypeDefPointer[], options: LoadTypedefsOptions): Promise<Source[]>;
22/**
23 * Synchronously loads executable documents (i.e. operations and fragments) from
24 * the provided pointers. The pointers may be individual files or a glob pattern.
25 * The files themselves may be `.graphql` files or `.js` and `.ts` (in which
26 * case they will be parsed using graphql-tag-pluck).
27 * @param pointerOrPointers Pointers to the files to load the documents from
28 * @param options Additional options
29 */
30export declare function loadDocumentsSync(pointerOrPointers: UnnormalizedTypeDefPointer | UnnormalizedTypeDefPointer[], options: LoadTypedefsOptions): Source[];
31export {};