1 | /**
|
2 | * GraphQL.js provides a reference implementation for the GraphQL specification
|
3 | * but is also a useful utility for operating on GraphQL files and building
|
4 | * sophisticated tools.
|
5 | *
|
6 | * This primary module exports a general purpose function for fulfilling all
|
7 | * steps of the GraphQL specification in a single operation, but also includes
|
8 | * utilities for every part of the GraphQL specification:
|
9 | *
|
10 | * - Parsing the GraphQL language.
|
11 | * - Building a GraphQL type schema.
|
12 | * - Validating a GraphQL request against a type schema.
|
13 | * - Executing a GraphQL request against a type schema.
|
14 | *
|
15 | * This also includes utility functions for operating on GraphQL types and
|
16 | * GraphQL documents to facilitate building tools.
|
17 | *
|
18 | * You may also import from each sub-directory directly. For example, the
|
19 | * following two import statements are equivalent:
|
20 | *
|
21 | * import { parse } from 'graphql';
|
22 | * import { parse } from 'graphql/language';
|
23 | */
|
24 | // The GraphQL.js version info.
|
25 | export { version, versionInfo } from './version'; // The primary entry point into fulfilling a GraphQL request.
|
26 |
|
27 | export { graphql, graphqlSync } from './graphql'; // Create and operate on GraphQL type definitions and schema.
|
28 |
|
29 | export { // Definitions
|
30 | GraphQLSchema, GraphQLDirective, GraphQLScalarType, GraphQLObjectType, GraphQLInterfaceType, GraphQLUnionType, GraphQLEnumType, GraphQLInputObjectType, GraphQLList, GraphQLNonNull, // Standard GraphQL Scalars
|
31 | specifiedScalarTypes, GraphQLInt, GraphQLFloat, GraphQLString, GraphQLBoolean, GraphQLID, // Built-in Directives defined by the Spec
|
32 | specifiedDirectives, GraphQLIncludeDirective, GraphQLSkipDirective, GraphQLDeprecatedDirective, // "Enum" of Type Kinds
|
33 | TypeKind, // Constant Deprecation Reason
|
34 | DEFAULT_DEPRECATION_REASON, // GraphQL Types for introspection.
|
35 | introspectionTypes, __Schema, __Directive, __DirectiveLocation, __Type, __Field, __InputValue, __EnumValue, __TypeKind, // Meta-field definitions.
|
36 | SchemaMetaFieldDef, TypeMetaFieldDef, TypeNameMetaFieldDef, // Predicates
|
37 | isSchema, isDirective, isType, isScalarType, isObjectType, isInterfaceType, isUnionType, isEnumType, isInputObjectType, isListType, isNonNullType, isInputType, isOutputType, isLeafType, isCompositeType, isAbstractType, isWrappingType, isNullableType, isNamedType, isRequiredArgument, isRequiredInputField, isSpecifiedScalarType, isIntrospectionType, isSpecifiedDirective, // Assertions
|
38 | assertSchema, assertDirective, assertType, assertScalarType, assertObjectType, assertInterfaceType, assertUnionType, assertEnumType, assertInputObjectType, assertListType, assertNonNullType, assertInputType, assertOutputType, assertLeafType, assertCompositeType, assertAbstractType, assertWrappingType, assertNullableType, assertNamedType, // Un-modifiers
|
39 | getNullableType, getNamedType, // Validate GraphQL schema.
|
40 | validateSchema, assertValidSchema } from './type';
|
41 | // Parse and operate on GraphQL language source files.
|
42 | export { Source, getLocation, // Print source location
|
43 | printLocation, printSourceLocation, // Lex
|
44 | createLexer, TokenKind, // Parse
|
45 | parse, parseValue, parseType, // Print
|
46 | print, // Visit
|
47 | visit, visitInParallel, visitWithTypeInfo, getVisitFn, BREAK, Kind, DirectiveLocation, // Predicates
|
48 | isDefinitionNode, isExecutableDefinitionNode, isSelectionNode, isValueNode, isTypeNode, isTypeSystemDefinitionNode, isTypeDefinitionNode, isTypeSystemExtensionNode, isTypeExtensionNode } from './language';
|
49 | // Execute GraphQL queries.
|
50 | export { execute, defaultFieldResolver, defaultTypeResolver, responsePathAsArray, getDirectiveValues } from './execution';
|
51 | export { subscribe, createSourceEventStream } from './subscription';
|
52 | // Validate GraphQL documents.
|
53 | export { validate, ValidationContext, // All validation rules in the GraphQL Specification.
|
54 | specifiedRules, // Individual validation rules.
|
55 | FieldsOnCorrectTypeRule, FragmentsOnCompositeTypesRule, KnownArgumentNamesRule, KnownDirectivesRule, KnownFragmentNamesRule, KnownTypeNamesRule, LoneAnonymousOperationRule, NoFragmentCyclesRule, NoUndefinedVariablesRule, NoUnusedFragmentsRule, NoUnusedVariablesRule, OverlappingFieldsCanBeMergedRule, PossibleFragmentSpreadsRule, ProvidedRequiredArgumentsRule, ScalarLeafsRule, SingleFieldSubscriptionsRule, UniqueArgumentNamesRule, UniqueDirectivesPerLocationRule, UniqueFragmentNamesRule, UniqueInputFieldNamesRule, UniqueOperationNamesRule, UniqueVariableNamesRule, ValuesOfCorrectTypeRule, VariablesAreInputTypesRule, VariablesInAllowedPositionRule } from './validation';
|
56 | // Create, format, and print GraphQL errors.
|
57 | export { GraphQLError, syntaxError, locatedError, printError, formatError } from './error';
|
58 | // Utilities for operating on GraphQL type schema and parsed sources.
|
59 | export { // Produce the GraphQL query recommended for a full schema introspection.
|
60 | // Accepts optional IntrospectionOptions.
|
61 | getIntrospectionQuery, // @deprecated: use getIntrospectionQuery - will be removed in v15.
|
62 | introspectionQuery, // Gets the target Operation from a Document.
|
63 | getOperationAST, // Gets the Type for the target Operation AST.
|
64 | getOperationRootType, // Convert a GraphQLSchema to an IntrospectionQuery.
|
65 | introspectionFromSchema, // Build a GraphQLSchema from an introspection result.
|
66 | buildClientSchema, // Build a GraphQLSchema from a parsed GraphQL Schema language AST.
|
67 | buildASTSchema, // Build a GraphQLSchema from a GraphQL schema language document.
|
68 | buildSchema, // @deprecated: Get the description from a schema AST node and supports legacy
|
69 | // syntax for specifying descriptions - will be removed in v16.
|
70 | getDescription, // Extends an existing GraphQLSchema from a parsed GraphQL Schema
|
71 | // language AST.
|
72 | extendSchema, // Sort a GraphQLSchema.
|
73 | lexicographicSortSchema, // Print a GraphQLSchema to GraphQL Schema language.
|
74 | printSchema, // Print a GraphQLType to GraphQL Schema language.
|
75 | printType, // Prints the built-in introspection schema in the Schema Language
|
76 | // format.
|
77 | printIntrospectionSchema, // Create a GraphQLType from a GraphQL language AST.
|
78 | typeFromAST, // Create a JavaScript value from a GraphQL language AST with a Type.
|
79 | valueFromAST, // Create a JavaScript value from a GraphQL language AST without a Type.
|
80 | valueFromASTUntyped, // Create a GraphQL language AST from a JavaScript value.
|
81 | astFromValue, // A helper to use within recursive-descent visitors which need to be aware of
|
82 | // the GraphQL type system.
|
83 | TypeInfo, // Coerces a JavaScript value to a GraphQL type, or produces errors.
|
84 | coerceInputValue, // @deprecated use coerceInputValue - will be removed in v15
|
85 | coerceValue, // @deprecated use coerceInputValue - will be removed in v15
|
86 | isValidJSValue, // @deprecated use validation - will be removed in v15
|
87 | isValidLiteralValue, // Concatenates multiple AST together.
|
88 | concatAST, // Separates an AST into an AST per Operation.
|
89 | separateOperations, // Strips characters that are not significant to the validity or execution
|
90 | // of a GraphQL document.
|
91 | stripIgnoredCharacters, // Comparators for types
|
92 | isEqualType, isTypeSubTypeOf, doTypesOverlap, // Asserts a string is a valid GraphQL name.
|
93 | assertValidName, // Determine if a string is a valid GraphQL name.
|
94 | isValidNameError, // Compares two GraphQLSchemas and detects breaking changes.
|
95 | BreakingChangeType, DangerousChangeType, findBreakingChanges, findDangerousChanges, // Report all deprecated usage within a GraphQL document.
|
96 | findDeprecatedUsages } from './utilities';
|