UNPKG

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