123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454 |
- // @flow strict
- /**
- * GraphQL.js provides a reference implementation for the GraphQL specification
- * but is also a useful utility for operating on GraphQL files and building
- * sophisticated tools.
- *
- * This primary module exports a general purpose function for fulfilling all
- * steps of the GraphQL specification in a single operation, but also includes
- * utilities for every part of the GraphQL specification:
- *
- * - Parsing the GraphQL language.
- * - Building a GraphQL type schema.
- * - Validating a GraphQL request against a type schema.
- * - Executing a GraphQL request against a type schema.
- *
- * This also includes utility functions for operating on GraphQL types and
- * GraphQL documents to facilitate building tools.
- *
- * You may also import from each sub-directory directly. For example, the
- * following two import statements are equivalent:
- *
- * import { parse } from 'graphql';
- * import { parse } from 'graphql/language';
- */
- // The GraphQL.js version info.
- export { version, versionInfo } from './version';
- // The primary entry point into fulfilling a GraphQL request.
- export type { GraphQLArgs } from './graphql';
- export { graphql, graphqlSync } from './graphql';
- // Create and operate on GraphQL type definitions and schema.
- export {
- // Definitions
- GraphQLSchema,
- GraphQLDirective,
- GraphQLScalarType,
- GraphQLObjectType,
- GraphQLInterfaceType,
- GraphQLUnionType,
- GraphQLEnumType,
- GraphQLInputObjectType,
- GraphQLList,
- GraphQLNonNull,
- // Standard GraphQL Scalars
- specifiedScalarTypes,
- GraphQLInt,
- GraphQLFloat,
- GraphQLString,
- GraphQLBoolean,
- GraphQLID,
- // Built-in Directives defined by the Spec
- specifiedDirectives,
- GraphQLIncludeDirective,
- GraphQLSkipDirective,
- GraphQLDeprecatedDirective,
- GraphQLSpecifiedByDirective,
- // "Enum" of Type Kinds
- TypeKind,
- // Constant Deprecation Reason
- DEFAULT_DEPRECATION_REASON,
- // GraphQL Types for introspection.
- introspectionTypes,
- __Schema,
- __Directive,
- __DirectiveLocation,
- __Type,
- __Field,
- __InputValue,
- __EnumValue,
- __TypeKind,
- // Meta-field definitions.
- SchemaMetaFieldDef,
- TypeMetaFieldDef,
- TypeNameMetaFieldDef,
- // Predicates
- 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
- assertSchema,
- assertDirective,
- assertType,
- assertScalarType,
- assertObjectType,
- assertInterfaceType,
- assertUnionType,
- assertEnumType,
- assertInputObjectType,
- assertListType,
- assertNonNullType,
- assertInputType,
- assertOutputType,
- assertLeafType,
- assertCompositeType,
- assertAbstractType,
- assertWrappingType,
- assertNullableType,
- assertNamedType,
- // Un-modifiers
- getNullableType,
- getNamedType,
- // Validate GraphQL schema.
- validateSchema,
- assertValidSchema,
- } from './type/index';
- export type {
- GraphQLType,
- GraphQLInputType,
- GraphQLOutputType,
- GraphQLLeafType,
- GraphQLCompositeType,
- GraphQLAbstractType,
- GraphQLWrappingType,
- GraphQLNullableType,
- GraphQLNamedType,
- Thunk,
- GraphQLSchemaConfig,
- GraphQLDirectiveConfig,
- GraphQLArgument,
- GraphQLArgumentConfig,
- GraphQLEnumTypeConfig,
- GraphQLEnumValue,
- GraphQLEnumValueConfig,
- GraphQLEnumValueConfigMap,
- GraphQLField,
- GraphQLFieldConfig,
- GraphQLFieldConfigArgumentMap,
- GraphQLFieldConfigMap,
- GraphQLFieldMap,
- GraphQLFieldResolver,
- GraphQLInputField,
- GraphQLInputFieldConfig,
- GraphQLInputFieldConfigMap,
- GraphQLInputFieldMap,
- GraphQLInputObjectTypeConfig,
- GraphQLInterfaceTypeConfig,
- GraphQLIsTypeOfFn,
- GraphQLObjectTypeConfig,
- GraphQLResolveInfo,
- ResponsePath,
- GraphQLScalarTypeConfig,
- GraphQLTypeResolver,
- GraphQLUnionTypeConfig,
- GraphQLScalarSerializer,
- GraphQLScalarValueParser,
- GraphQLScalarLiteralParser,
- } from './type/index';
- // Parse and operate on GraphQL language source files.
- export {
- Token,
- Source,
- Location,
- getLocation,
- // Print source location
- printLocation,
- printSourceLocation,
- // Lex
- Lexer,
- TokenKind,
- // Parse
- parse,
- parseValue,
- parseType,
- // Print
- print,
- // Visit
- visit,
- visitInParallel,
- getVisitFn,
- BREAK,
- Kind,
- DirectiveLocation,
- // Predicates
- isDefinitionNode,
- isExecutableDefinitionNode,
- isSelectionNode,
- isValueNode,
- isTypeNode,
- isTypeSystemDefinitionNode,
- isTypeDefinitionNode,
- isTypeSystemExtensionNode,
- isTypeExtensionNode,
- } from './language/index';
- export type {
- ParseOptions,
- SourceLocation,
- TokenKindEnum,
- KindEnum,
- DirectiveLocationEnum,
- // Visitor utilities
- ASTVisitor,
- Visitor,
- VisitFn,
- VisitorKeyMap,
- // AST nodes
- ASTNode,
- ASTKindToNode,
- // Each kind of AST node
- NameNode,
- DocumentNode,
- DefinitionNode,
- ExecutableDefinitionNode,
- OperationDefinitionNode,
- OperationTypeNode,
- VariableDefinitionNode,
- VariableNode,
- SelectionSetNode,
- SelectionNode,
- FieldNode,
- ArgumentNode,
- FragmentSpreadNode,
- InlineFragmentNode,
- FragmentDefinitionNode,
- ValueNode,
- IntValueNode,
- FloatValueNode,
- StringValueNode,
- BooleanValueNode,
- NullValueNode,
- EnumValueNode,
- ListValueNode,
- ObjectValueNode,
- ObjectFieldNode,
- DirectiveNode,
- TypeNode,
- NamedTypeNode,
- ListTypeNode,
- NonNullTypeNode,
- TypeSystemDefinitionNode,
- SchemaDefinitionNode,
- OperationTypeDefinitionNode,
- TypeDefinitionNode,
- ScalarTypeDefinitionNode,
- ObjectTypeDefinitionNode,
- FieldDefinitionNode,
- InputValueDefinitionNode,
- InterfaceTypeDefinitionNode,
- UnionTypeDefinitionNode,
- EnumTypeDefinitionNode,
- EnumValueDefinitionNode,
- InputObjectTypeDefinitionNode,
- DirectiveDefinitionNode,
- TypeSystemExtensionNode,
- SchemaExtensionNode,
- TypeExtensionNode,
- ScalarTypeExtensionNode,
- ObjectTypeExtensionNode,
- InterfaceTypeExtensionNode,
- UnionTypeExtensionNode,
- EnumTypeExtensionNode,
- InputObjectTypeExtensionNode,
- } from './language/index';
- // Execute GraphQL queries.
- export {
- execute,
- executeSync,
- defaultFieldResolver,
- defaultTypeResolver,
- responsePathAsArray,
- getDirectiveValues,
- } from './execution/index';
- export type {
- ExecutionArgs,
- ExecutionResult,
- FormattedExecutionResult,
- } from './execution/index';
- export { subscribe, createSourceEventStream } from './subscription/index';
- export type { SubscriptionArgs } from './subscription/index';
- // Validate GraphQL documents.
- export {
- validate,
- ValidationContext,
- // All validation rules in the GraphQL Specification.
- specifiedRules,
- // Individual validation rules.
- ExecutableDefinitionsRule,
- 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,
- // SDL-specific validation rules
- LoneSchemaDefinitionRule,
- UniqueOperationTypesRule,
- UniqueTypeNamesRule,
- UniqueEnumValueNamesRule,
- UniqueFieldDefinitionNamesRule,
- UniqueDirectiveNamesRule,
- PossibleTypeExtensionsRule,
- // Custom validation rules
- NoDeprecatedCustomRule,
- NoSchemaIntrospectionCustomRule,
- } from './validation/index';
- export type { ValidationRule } from './validation/index';
- // Create, format, and print GraphQL errors.
- export {
- GraphQLError,
- syntaxError,
- locatedError,
- printError,
- formatError,
- } from './error/index';
- export type { GraphQLFormattedError } from './error/index';
- // Utilities for operating on GraphQL type schema and parsed sources.
- export {
- // Produce the GraphQL query recommended for a full schema introspection.
- // Accepts optional IntrospectionOptions.
- getIntrospectionQuery,
- // Gets the target Operation from a Document.
- getOperationAST,
- // Gets the Type for the target Operation AST.
- getOperationRootType,
- // Convert a GraphQLSchema to an IntrospectionQuery.
- introspectionFromSchema,
- // Build a GraphQLSchema from an introspection result.
- buildClientSchema,
- // Build a GraphQLSchema from a parsed GraphQL Schema language AST.
- buildASTSchema,
- // Build a GraphQLSchema from a GraphQL schema language document.
- buildSchema,
- // @deprecated: Get the description from a schema AST node and supports legacy
- // syntax for specifying descriptions - will be removed in v16.
- getDescription,
- // Extends an existing GraphQLSchema from a parsed GraphQL Schema
- // language AST.
- extendSchema,
- // Sort a GraphQLSchema.
- lexicographicSortSchema,
- // Print a GraphQLSchema to GraphQL Schema language.
- printSchema,
- // Print a GraphQLType to GraphQL Schema language.
- printType,
- // Prints the built-in introspection schema in the Schema Language
- // format.
- printIntrospectionSchema,
- // Create a GraphQLType from a GraphQL language AST.
- typeFromAST,
- // Create a JavaScript value from a GraphQL language AST with a Type.
- valueFromAST,
- // Create a JavaScript value from a GraphQL language AST without a Type.
- valueFromASTUntyped,
- // Create a GraphQL language AST from a JavaScript value.
- astFromValue,
- // A helper to use within recursive-descent visitors which need to be aware of
- // the GraphQL type system.
- TypeInfo,
- visitWithTypeInfo,
- // Coerces a JavaScript value to a GraphQL type, or produces errors.
- coerceInputValue,
- // Concatenates multiple AST together.
- concatAST,
- // Separates an AST into an AST per Operation.
- separateOperations,
- // Strips characters that are not significant to the validity or execution
- // of a GraphQL document.
- stripIgnoredCharacters,
- // Comparators for types
- isEqualType,
- isTypeSubTypeOf,
- doTypesOverlap,
- // Asserts a string is a valid GraphQL name.
- assertValidName,
- // Determine if a string is a valid GraphQL name.
- isValidNameError,
- // Compares two GraphQLSchemas and detects breaking changes.
- BreakingChangeType,
- DangerousChangeType,
- findBreakingChanges,
- findDangerousChanges,
- // @deprecated: Report all deprecated usage within a GraphQL document.
- findDeprecatedUsages,
- } from './utilities/index';
- export type {
- IntrospectionOptions,
- IntrospectionQuery,
- IntrospectionSchema,
- IntrospectionType,
- IntrospectionInputType,
- IntrospectionOutputType,
- IntrospectionScalarType,
- IntrospectionObjectType,
- IntrospectionInterfaceType,
- IntrospectionUnionType,
- IntrospectionEnumType,
- IntrospectionInputObjectType,
- IntrospectionTypeRef,
- IntrospectionInputTypeRef,
- IntrospectionOutputTypeRef,
- IntrospectionNamedTypeRef,
- IntrospectionListTypeRef,
- IntrospectionNonNullTypeRef,
- IntrospectionField,
- IntrospectionInputValue,
- IntrospectionEnumValue,
- IntrospectionDirective,
- BuildSchemaOptions,
- BreakingChange,
- DangerousChange,
- } from './utilities/index';
|