diff --git a/src/error/index.js b/src/error/index.js index a383b2c34a..70705ffdd0 100644 --- a/src/error/index.js +++ b/src/error/index.js @@ -8,9 +8,12 @@ */ export { GraphQLError } from './GraphQLError'; + export { syntaxError } from './syntaxError'; + export { locatedError } from './locatedError'; + export { printError } from './printError'; -export { formatError } from './formatError'; +export { formatError } from './formatError'; export type { GraphQLFormattedError } from './formatError'; diff --git a/src/execution/index.js b/src/execution/index.js index 6c775b1cbc..27b6e0b805 100644 --- a/src/execution/index.js +++ b/src/execution/index.js @@ -13,6 +13,6 @@ export { defaultTypeResolver, responsePathAsArray, } from './execute'; -export { getDirectiveValues } from './values'; - export type { ExecutionArgs, ExecutionResult } from './execute'; + +export { getDirectiveValues } from './values'; diff --git a/src/index.js b/src/index.js index 43d92cb584..e52bd6a186 100644 --- a/src/index.js +++ b/src/index.js @@ -37,8 +37,9 @@ export { graphql, graphqlSync } from './graphql'; // Create and operate on GraphQL type definitions and schema. export { - GraphQLSchema, // Definitions + GraphQLSchema, + GraphQLDirective, GraphQLScalarType, GraphQLObjectType, GraphQLInterfaceType, @@ -47,10 +48,7 @@ export { GraphQLInputObjectType, GraphQLList, GraphQLNonNull, - GraphQLDirective, - // "Enum" of Type Kinds - TypeKind, - // Scalars + // Standard GraphQL Scalars specifiedScalarTypes, GraphQLInt, GraphQLFloat, @@ -62,12 +60,10 @@ export { GraphQLIncludeDirective, GraphQLSkipDirective, GraphQLDeprecatedDirective, + // "Enum" of Type Kinds + TypeKind, // Constant Deprecation Reason DEFAULT_DEPRECATION_REASON, - // Meta-field definitions. - SchemaMetaFieldDef, - TypeMetaFieldDef, - TypeNameMetaFieldDef, // GraphQL Types for introspection. introspectionTypes, __Schema, @@ -78,6 +74,10 @@ export { __InputValue, __EnumValue, __TypeKind, + // Meta-field definitions. + SchemaMetaFieldDef, + TypeMetaFieldDef, + TypeNameMetaFieldDef, // Predicates isSchema, isDirective, @@ -143,6 +143,7 @@ export type { GraphQLNamedType, Thunk, GraphQLSchemaConfig, + GraphQLDirectiveConfig, GraphQLArgument, GraphQLArgumentConfig, GraphQLEnumTypeConfig, @@ -168,7 +169,6 @@ export type { GraphQLScalarTypeConfig, GraphQLTypeResolver, GraphQLUnionTypeConfig, - GraphQLDirectiveConfig, GraphQLScalarSerializer, GraphQLScalarValueParser, GraphQLScalarLiteralParser, @@ -180,6 +180,7 @@ export { getLocation, // Lex createLexer, + TokenKind, // Parse parse, parseValue, @@ -191,10 +192,9 @@ export { visitInParallel, visitWithTypeInfo, getVisitFn, + BREAK, Kind, - TokenKind, DirectiveLocation, - BREAK, // Predicates isDefinitionNode, isExecutableDefinitionNode, @@ -211,16 +211,20 @@ export type { Lexer, ParseOptions, SourceLocation, + Location, + Token, + TokenKindEnum, + KindEnum, + DirectiveLocationEnum, // Visitor utilities ASTVisitor, Visitor, VisitFn, VisitorKeyMap, // AST nodes - Location, - Token, ASTNode, ASTKindToNode, + // Each kind of AST node NameNode, DocumentNode, DefinitionNode, @@ -274,9 +278,6 @@ export type { UnionTypeExtensionNode, EnumTypeExtensionNode, InputObjectTypeExtensionNode, - KindEnum, - TokenKindEnum, - DirectiveLocationEnum, } from './language'; // Execute GraphQL queries. @@ -292,7 +293,7 @@ export type { ExecutionArgs, ExecutionResult } from './execution'; export { subscribe, createSourceEventStream } from './subscription'; -// Validate GraphQL queries. +// Validate GraphQL documents. export { validate, ValidationContext, @@ -344,13 +345,13 @@ export { // Produce the GraphQL query recommended for a full schema introspection. // Accepts optional IntrospectionOptions. getIntrospectionQuery, - // @deprecated: use getIntrospectionQuery - will be removed in v15 + // @deprecated: use getIntrospectionQuery - will be removed in v15. introspectionQuery, - // Gets the target Operation from a Document + // Gets the target Operation from a Document. getOperationAST, // Gets the Type for the target Operation AST. getOperationRootType, - // Convert a GraphQLSchema to an IntrospectionQuery + // Convert a GraphQLSchema to an IntrospectionQuery. introspectionFromSchema, // Build a GraphQLSchema from an introspection result. buildClientSchema, @@ -359,7 +360,7 @@ export { // 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 + // syntax for specifying descriptions - will be removed in v16. getDescription, // Extends an existing GraphQLSchema from a parsed GraphQL Schema // language AST. @@ -368,11 +369,11 @@ export { 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, - // Print a GraphQLType to GraphQL Schema language. - printType, // Create a GraphQLType from a GraphQL language AST. typeFromAST, // Create a JavaScript value from a GraphQL language AST with a Type. @@ -406,38 +407,38 @@ export { // Determine if a string is a valid GraphQL name. isValidNameError, // Compares two GraphQLSchemas and detects breaking changes. - findBreakingChanges, - findDangerousChanges, BreakingChangeType, DangerousChangeType, + findBreakingChanges, + findDangerousChanges, // Report all deprecated usage within a GraphQL document. findDeprecatedUsages, } from './utilities'; export type { - BuildSchemaOptions, - BreakingChange, - DangerousChange, IntrospectionOptions, - IntrospectionDirective, + IntrospectionQuery, + IntrospectionSchema, + IntrospectionType, + IntrospectionInputType, + IntrospectionOutputType, + IntrospectionScalarType, + IntrospectionObjectType, + IntrospectionInterfaceType, + IntrospectionUnionType, IntrospectionEnumType, - IntrospectionEnumValue, - IntrospectionField, IntrospectionInputObjectType, - IntrospectionInputType, + IntrospectionTypeRef, IntrospectionInputTypeRef, - IntrospectionInputValue, - IntrospectionInterfaceType, - IntrospectionListTypeRef, + IntrospectionOutputTypeRef, IntrospectionNamedTypeRef, + IntrospectionListTypeRef, IntrospectionNonNullTypeRef, - IntrospectionObjectType, - IntrospectionOutputType, - IntrospectionOutputTypeRef, - IntrospectionQuery, - IntrospectionScalarType, - IntrospectionSchema, - IntrospectionType, - IntrospectionTypeRef, - IntrospectionUnionType, + IntrospectionField, + IntrospectionInputValue, + IntrospectionEnumValue, + IntrospectionDirective, + BuildSchemaOptions, + BreakingChange, + DangerousChange, } from './utilities'; diff --git a/src/language/index.js b/src/language/index.js index 023ae7ace9..532cf2a24a 100644 --- a/src/language/index.js +++ b/src/language/index.js @@ -7,14 +7,22 @@ * @flow strict */ +export { Source } from './source'; + export { getLocation } from './location'; export type { SourceLocation } from './location'; + export { Kind } from './kinds'; export type { KindEnum } from './kinds'; + export { createLexer, TokenKind } from './lexer'; +export type { Lexer, TokenKindEnum } from './lexer'; + export { parse, parseValue, parseType } from './parser'; +export type { ParseOptions } from './parser'; + export { print } from './printer'; -export { Source } from './source'; + export { visit, visitInParallel, @@ -24,9 +32,6 @@ export { } from './visitor'; export type { ASTVisitor, Visitor, VisitFn, VisitorKeyMap } from './visitor'; -export type { Lexer, TokenKindEnum } from './lexer'; -export type { ParseOptions } from './parser'; - export type { Location, Token, diff --git a/src/type/index.js b/src/type/index.js index b04cb044a2..6044550b55 100644 --- a/src/type/index.js +++ b/src/type/index.js @@ -93,7 +93,9 @@ export type { GraphQLDirectiveConfig } from './directives'; // Common built-in scalar instances. export { + // Predicate isSpecifiedScalarType, + // Standard GraphQL Scalars specifiedScalarTypes, GraphQLInt, GraphQLFloat, @@ -103,10 +105,9 @@ export { } from './scalars'; export { - // "Enum" of Type Kinds - TypeKind, - // GraphQL Types for introspection. + // Predicate isIntrospectionType, + // GraphQL Types for introspection. introspectionTypes, __Schema, __Directive, @@ -116,6 +117,8 @@ export { __InputValue, __EnumValue, __TypeKind, + // "Enum" of Type Kinds + TypeKind, // Meta-field definitions. SchemaMetaFieldDef, TypeMetaFieldDef, @@ -163,4 +166,5 @@ export type { GraphQLScalarLiteralParser, } from './definition'; +// Validate GraphQL schema. export { validateSchema, assertValidSchema } from './validate'; diff --git a/src/utilities/index.js b/src/utilities/index.js index 51185ffb3a..aa0daafe15 100644 --- a/src/utilities/index.js +++ b/src/utilities/index.js @@ -9,10 +9,13 @@ // The GraphQL query recommended for a full schema introspection. export { + // Produce the GraphQL query recommended for a full schema introspection. + // Accepts optional IntrospectionOptions. getIntrospectionQuery, - // @deprecated, use getIntrospectionQuery() - will be removed in v15 + // @deprecated, use getIntrospectionQuery() - will be removed in v15. introspectionQuery, } from './introspectionQuery'; + export type { IntrospectionOptions, IntrospectionQuery, @@ -38,13 +41,13 @@ export type { IntrospectionDirective, } from './introspectionQuery'; -// Gets the target Operation from a Document +// Gets the target Operation from a Document. export { getOperationAST } from './getOperationAST'; // Gets the Type for the target Operation AST. export { getOperationRootType } from './getOperationRootType'; -// Convert a GraphQLSchema to an IntrospectionQuery +// Convert a GraphQLSchema to an IntrospectionQuery. export { introspectionFromSchema } from './introspectionFromSchema'; // Build a GraphQLSchema from an introspection result. @@ -55,7 +58,7 @@ export { buildASTSchema, buildSchema, // @deprecated: Get the description from a schema AST node and supports legacy - // syntax for specifying descriptions - will be removed in v16 + // syntax for specifying descriptions - will be removed in v16. getDescription, } from './buildASTSchema'; export type { BuildSchemaOptions } from './buildASTSchema'; @@ -92,7 +95,7 @@ export { TypeInfo } from './TypeInfo'; // Coerces a JavaScript value to a GraphQL type, or produces errors. export { coerceValue } from './coerceValue'; -// @deprecated use coerceValue - will be removed in v15 +// @deprecated use coerceValue - will be removed in v15. export { isValidJSValue } from './isValidJSValue'; // @deprecated use validation - will be removed in v15 diff --git a/src/validation/index.js b/src/validation/index.js index ffcf492fc8..f3e1ebfbce 100644 --- a/src/validation/index.js +++ b/src/validation/index.js @@ -12,6 +12,7 @@ export { validate } from './validate'; export { ValidationContext } from './ValidationContext'; export type { ValidationRule } from './ValidationContext'; +// All validation rules in the GraphQL Specification. export { specifiedRules } from './specifiedRules'; // Spec Section: "Field Selections on Objects, Interfaces, and Unions Types"