diff --git a/src/index.ts b/src/index.ts index fddd884198..bde23ad563 100644 --- a/src/index.ts +++ b/src/index.ts @@ -22,20 +22,22 @@ * import { parse } from 'graphql'; * import { parse } from 'graphql/language'; * ``` + * + * @packageDocumentation */ -/** The GraphQL.js version info. */ +// The GraphQL.js version info. export { version, versionInfo } from './version'; -/** The primary entry point into fulfilling a GraphQL request. */ +// 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. */ +// Create and operate on GraphQL type definitions and schema. export { resolveObjMapThunk, resolveReadonlyArrayThunk, - /** Definitions */ + // Definitions GraphQLSchema, GraphQLDirective, GraphQLScalarType, @@ -46,27 +48,27 @@ export { GraphQLInputObjectType, GraphQLList, GraphQLNonNull, - /** Standard GraphQL Scalars */ + // Standard GraphQL Scalars specifiedScalarTypes, GraphQLInt, GraphQLFloat, GraphQLString, GraphQLBoolean, GraphQLID, - /** Int boundaries constants */ + // Int boundaries constants GRAPHQL_MAX_INT, GRAPHQL_MIN_INT, - /** Built-in Directives defined by the Spec */ + // Built-in Directives defined by the Spec specifiedDirectives, GraphQLIncludeDirective, GraphQLSkipDirective, GraphQLDeprecatedDirective, GraphQLSpecifiedByDirective, - /** "Enum" of Type Kinds */ + // "Enum" of Type Kinds TypeKind, - /** Constant Deprecation Reason */ + // Constant Deprecation Reason DEFAULT_DEPRECATION_REASON, - /** GraphQL Types for introspection. */ + // GraphQL Types for introspection. introspectionTypes, __Schema, __Directive, @@ -76,11 +78,11 @@ export { __InputValue, __EnumValue, __TypeKind, - /** Meta-field definitions. */ + // Meta-field definitions. SchemaMetaFieldDef, TypeMetaFieldDef, TypeNameMetaFieldDef, - /** Predicates */ + // Predicates isSchema, isDirective, isType, @@ -105,7 +107,7 @@ export { isSpecifiedScalarType, isIntrospectionType, isSpecifiedDirective, - /** Assertions */ + // Assertions assertSchema, assertDirective, assertType, @@ -125,13 +127,13 @@ export { assertWrappingType, assertNullableType, assertNamedType, - /** Un-modifiers */ + // Un-modifiers getNullableType, getNamedType, - /** Validate GraphQL schema. */ + // Validate GraphQL schema. validateSchema, assertValidSchema, - /** Upholds the spec rules about naming. */ + // Upholds the spec rules about naming. assertName, assertEnumValueName, } from './type/index'; @@ -194,27 +196,27 @@ export type { GraphQLScalarLiteralParser, } from './type/index'; -/** Parse and operate on GraphQL language source files. */ +// Parse and operate on GraphQL language source files. export { Token, Source, Location, OperationTypeNode, getLocation, - /** Print source location */ + // Print source location. printLocation, printSourceLocation, - /** Lex */ + // Lex Lexer, TokenKind, - /** Parse */ + // Parse parse, parseValue, parseConstValue, parseType, - /** Print */ + // Print print, - /** Visit */ + // Visit visit, visitInParallel, getVisitFn, @@ -222,7 +224,7 @@ export { BREAK, Kind, DirectiveLocation, - /** Predicates */ + // Predicates isDefinitionNode, isExecutableDefinitionNode, isSelectionNode, @@ -241,14 +243,14 @@ export type { TokenKindEnum, KindEnum, DirectiveLocationEnum, - /** Visitor utilities */ + // Visitor utilities ASTVisitor, ASTVisitFn, ASTVisitorKeyMap, - /** AST nodes */ + // AST nodes ASTNode, ASTKindToNode, - /** Each kind of AST node */ + // Each kind of AST node NameNode, DocumentNode, DefinitionNode, @@ -309,7 +311,7 @@ export type { InputObjectTypeExtensionNode, } from './language/index'; -/** Execute GraphQL queries. */ +// Execute GraphQL queries. export { execute, executeSync, @@ -329,13 +331,13 @@ export type { export type { SubscriptionArgs } from './subscription/index'; -/** Validate GraphQL documents. */ +// Validate GraphQL documents. export { validate, ValidationContext, - /** All validation rules in the GraphQL Specification. */ + // All validation rules in the GraphQL Specification. specifiedRules, - /** Individual validation rules. */ + // Individual validation rules. ExecutableDefinitionsRule, FieldsOnCorrectTypeRule, FragmentsOnCompositeTypesRule, @@ -362,7 +364,7 @@ export { ValuesOfCorrectTypeRule, VariablesAreInputTypesRule, VariablesInAllowedPositionRule, - /** SDL-specific validation rules */ + // SDL-specific validation rules LoneSchemaDefinitionRule, UniqueOperationTypesRule, UniqueTypeNamesRule, @@ -371,14 +373,14 @@ export { UniqueArgumentDefinitionNamesRule, UniqueDirectiveNamesRule, PossibleTypeExtensionsRule, - /** Custom validation rules */ + // Custom validation rules NoDeprecatedCustomRule, NoSchemaIntrospectionCustomRule, } from './validation/index'; export type { ValidationRule } from './validation/index'; -/** Create, format, and print GraphQL errors. */ +// Create, format, and print GraphQL errors. export { GraphQLError, syntaxError, @@ -392,63 +394,61 @@ export type { GraphQLErrorExtensions, } from './error/index'; -/** Utilities for operating on GraphQL type schema and parsed sources. */ +// Utilities for operating on GraphQL type schema and parsed sources. export { - /** - * Produce the GraphQL query recommended for a full schema introspection. - * Accepts optional IntrospectionOptions. - */ + // Produce the GraphQL query recommended for a full schema introspection. + // Accepts optional IntrospectionOptions. getIntrospectionQuery, - /** Gets the target Operation from a Document. */ + // Gets the target Operation from a Document. getOperationAST, - /** Gets the Type for the target Operation AST. */ + // 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. */ + // Build a GraphQLSchema from an introspection result. buildClientSchema, - /** Build a GraphQLSchema from a parsed GraphQL Schema language AST. */ + // Build a GraphQLSchema from a parsed GraphQL Schema language AST. buildASTSchema, - /** Build a GraphQLSchema from a GraphQL schema language document. */ + // Build a GraphQLSchema from a GraphQL schema language document. buildSchema, - /** Extends an existing GraphQLSchema from a parsed GraphQL Schema language AST. */ + // Extends an existing GraphQLSchema from a parsed GraphQL Schema language AST. extendSchema, - /** Sort a GraphQLSchema. */ + // Sort a GraphQLSchema. lexicographicSortSchema, - /** Print a GraphQLSchema to GraphQL Schema language. */ + // Print a GraphQLSchema to GraphQL Schema language. printSchema, - /** Print a GraphQLType to GraphQL Schema language. */ + // Print a GraphQLType to GraphQL Schema language. printType, - /** Prints the built-in introspection schema in the Schema Language format. */ + // Prints the built-in introspection schema in the Schema Language format. printIntrospectionSchema, - /** Create a GraphQLType from a GraphQL language AST. */ + // Create a GraphQLType from a GraphQL language AST. typeFromAST, - /** Create a JavaScript value from a GraphQL language AST with a Type. */ + // 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. */ + // Create a JavaScript value from a GraphQL language AST without a Type. valueFromASTUntyped, - /** Create a GraphQL language AST from a JavaScript value. */ + // 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. */ + // 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. */ + // Coerces a JavaScript value to a GraphQL type, or produces errors. coerceInputValue, - /** Concatenates multiple AST together. */ + // Concatenates multiple AST together. concatAST, - /** Separates an AST into an AST per Operation. */ + // Separates an AST into an AST per Operation. separateOperations, - /** Strips characters that are not significant to the validity or execution of a GraphQL document. */ + // Strips characters that are not significant to the validity or execution of a GraphQL document. stripIgnoredCharacters, - /** Comparators for types */ + // Comparators for types isEqualType, isTypeSubTypeOf, doTypesOverlap, - /** Asserts a string is a valid GraphQL name. */ + // Asserts a string is a valid GraphQL name. assertValidName, - /** Determine if a string is a valid GraphQL name. */ + // Determine if a string is a valid GraphQL name. isValidNameError, - /** Compares two GraphQLSchemas and detects breaking changes. */ + // Compares two GraphQLSchemas and detects breaking changes. BreakingChangeType, DangerousChangeType, findBreakingChanges, diff --git a/src/language/index.ts b/src/language/index.ts index fc0583ec6f..ec4d195e1a 100644 --- a/src/language/index.ts +++ b/src/language/index.ts @@ -31,7 +31,7 @@ export { Location, Token, OperationTypeNode } from './ast'; export type { ASTNode, ASTKindToNode, - /** Each kind of AST node */ + // Each kind of AST node NameNode, DocumentNode, DefinitionNode, diff --git a/src/type/index.ts b/src/type/index.ts index 72f24be4d6..270dd67d35 100644 --- a/src/type/index.ts +++ b/src/type/index.ts @@ -1,11 +1,11 @@ export type { Path as ResponsePath } from '../jsutils/Path'; export { - /** Predicate */ + // Predicate isSchema, - /** Assertion */ + // Assertion assertSchema, - /** GraphQL Schema definition */ + // GraphQL Schema definition GraphQLSchema, } from './schema'; export type { GraphQLSchemaConfig, GraphQLSchemaExtensions } from './schema'; @@ -13,7 +13,7 @@ export type { GraphQLSchemaConfig, GraphQLSchemaExtensions } from './schema'; export { resolveObjMapThunk, resolveReadonlyArrayThunk, - /** Predicates */ + // Predicates isType, isScalarType, isObjectType, @@ -33,7 +33,7 @@ export { isNamedType, isRequiredArgument, isRequiredInputField, - /** Assertions */ + // Assertions assertType, assertScalarType, assertObjectType, @@ -51,17 +51,17 @@ export { assertWrappingType, assertNullableType, assertNamedType, - /** Un-modifiers */ + // Un-modifiers getNullableType, getNamedType, - /** Definitions */ + // Definitions GraphQLScalarType, GraphQLObjectType, GraphQLInterfaceType, GraphQLUnionType, GraphQLEnumType, GraphQLInputObjectType, - /** Type Wrappers */ + // Type Wrappers GraphQLList, GraphQLNonNull, } from './definition'; @@ -120,20 +120,20 @@ export type { } from './definition'; export { - /** Predicate */ + // Predicate isDirective, - /** Assertion */ + // Assertion assertDirective, - /** Directives Definition */ + // Directives Definition GraphQLDirective, - /** Built-in Directives defined by the Spec */ + // Built-in Directives defined by the Spec isSpecifiedDirective, specifiedDirectives, GraphQLIncludeDirective, GraphQLSkipDirective, GraphQLDeprecatedDirective, GraphQLSpecifiedByDirective, - /** Constant Deprecation Reason */ + // Constant Deprecation Reason DEFAULT_DEPRECATION_REASON, } from './directives'; @@ -142,26 +142,26 @@ export type { GraphQLDirectiveExtensions, } from './directives'; -/** Common built-in scalar instances. */ +// Common built-in scalar instances. export { - /** Predicate */ + // Predicate isSpecifiedScalarType, - /** Standard GraphQL Scalars */ + // Standard GraphQL Scalars specifiedScalarTypes, GraphQLInt, GraphQLFloat, GraphQLString, GraphQLBoolean, GraphQLID, - /** Int boundaries constants */ + // Int boundaries constants GRAPHQL_MAX_INT, GRAPHQL_MIN_INT, } from './scalars'; export { - /** Predicate */ + // Predicate isIntrospectionType, - /** GraphQL Types for introspection. */ + // GraphQL Types for introspection. introspectionTypes, __Schema, __Directive, @@ -171,16 +171,16 @@ export { __InputValue, __EnumValue, __TypeKind, - /** "Enum" of Type Kinds */ + // "Enum" of Type Kinds TypeKind, - /** Meta-field definitions. */ + // Meta-field definitions. SchemaMetaFieldDef, TypeMetaFieldDef, TypeNameMetaFieldDef, } from './introspection'; -/** Validate GraphQL schema. */ +// Validate GraphQL schema. export { validateSchema, assertValidSchema } from './validate'; -/** Upholds the spec rules about naming. */ +// Upholds the spec rules about naming. export { assertName, assertEnumValueName } from './assertName'; diff --git a/src/utilities/getIntrospectionQuery.ts b/src/utilities/getIntrospectionQuery.ts index 2720e0b45d..c21fe9a1bb 100644 --- a/src/utilities/getIntrospectionQuery.ts +++ b/src/utilities/getIntrospectionQuery.ts @@ -34,6 +34,10 @@ export interface IntrospectionOptions { inputValueDeprecation?: boolean; } +/** + * Produce the GraphQL query recommended for a full schema introspection. + * Accepts optional IntrospectionOptions. + */ export function getIntrospectionQuery(options?: IntrospectionOptions): string { const optionsWithDefault = { descriptions: true, diff --git a/src/utilities/index.ts b/src/utilities/index.ts index a1411f508e..452b975233 100644 --- a/src/utilities/index.ts +++ b/src/utilities/index.ts @@ -1,7 +1,4 @@ -/** - * Produce the GraphQL query recommended for a full schema introspection. - * Accepts optional IntrospectionOptions. - */ +// Produce the GraphQL query recommended for a full schema introspection. export { getIntrospectionQuery } from './getIntrospectionQuery'; export type { @@ -29,73 +26,73 @@ export type { IntrospectionDirective, } from './getIntrospectionQuery'; -/** 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. */ +// 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. */ +// Build a GraphQLSchema from an introspection result. export { buildClientSchema } from './buildClientSchema'; -/** Build a GraphQLSchema from GraphQL Schema language. */ +// Build a GraphQLSchema from GraphQL Schema language. export { buildASTSchema, buildSchema } from './buildASTSchema'; export type { BuildSchemaOptions } from './buildASTSchema'; -/** Extends an existing GraphQLSchema from a parsed GraphQL Schema language AST. */ +// Extends an existing GraphQLSchema from a parsed GraphQL Schema language AST. export { extendSchema } from './extendSchema'; -/** Sort a GraphQLSchema. */ +// Sort a GraphQLSchema. export { lexicographicSortSchema } from './lexicographicSortSchema'; -/** Print a GraphQLSchema to GraphQL Schema language. */ +// Print a GraphQLSchema to GraphQL Schema language. export { printSchema, printType, printIntrospectionSchema, } from './printSchema'; -/** Create a GraphQLType from a GraphQL language AST. */ +// Create a GraphQLType from a GraphQL language AST. export { typeFromAST } from './typeFromAST'; -/** Create a JavaScript value from a GraphQL language AST with a type. */ +// Create a JavaScript value from a GraphQL language AST with a type. export { valueFromAST } from './valueFromAST'; -/** Create a JavaScript value from a GraphQL language AST without a type. */ +// Create a JavaScript value from a GraphQL language AST without a type. export { valueFromASTUntyped } from './valueFromASTUntyped'; -/** Create a GraphQL language AST from a JavaScript value. */ +// Create a GraphQL language AST from a JavaScript value. export { astFromValue } from './astFromValue'; -/** A helper to use within recursive-descent visitors which need to be aware of the GraphQL type system. */ +// A helper to use within recursive-descent visitors which need to be aware of the GraphQL type system. export { TypeInfo, visitWithTypeInfo } from './TypeInfo'; -/** Coerces a JavaScript value to a GraphQL type, or produces errors. */ +// Coerces a JavaScript value to a GraphQL type, or produces errors. export { coerceInputValue } from './coerceInputValue'; -/** Concatenates multiple AST together. */ +// Concatenates multiple AST together. export { concatAST } from './concatAST'; -/** Separates an AST into an AST per Operation. */ +// Separates an AST into an AST per Operation. export { separateOperations } from './separateOperations'; -/** Strips characters that are not significant to the validity or execution of a GraphQL document. */ +// Strips characters that are not significant to the validity or execution of a GraphQL document. export { stripIgnoredCharacters } from './stripIgnoredCharacters'; -/** Comparators for types */ +// Comparators for types export { isEqualType, isTypeSubTypeOf, doTypesOverlap, } from './typeComparators'; -/** Asserts that a string is a valid GraphQL name */ +// Asserts that a string is a valid GraphQL name export { assertValidName, isValidNameError } from './assertValidName'; -/** Compares two GraphQLSchemas and detects breaking changes. */ +// Compares two GraphQLSchemas and detects breaking changes. export { BreakingChangeType, DangerousChangeType, @@ -104,5 +101,5 @@ export { } from './findBreakingChanges'; export type { BreakingChange, DangerousChange } from './findBreakingChanges'; -/** Wrapper type that contains DocumentNode and types that can be deduced from it. */ +// Wrapper type that contains DocumentNode and types that can be deduced from it. export type { TypedQueryDocumentNode } from './typedQueryDocumentNode'; diff --git a/src/validation/index.ts b/src/validation/index.ts index 584faf3440..58cc012ee8 100644 --- a/src/validation/index.ts +++ b/src/validation/index.ts @@ -3,88 +3,88 @@ export { validate } from './validate'; export { ValidationContext } from './ValidationContext'; export type { ValidationRule } from './ValidationContext'; -/** All validation rules in the GraphQL Specification. */ +// All validation rules in the GraphQL Specification. export { specifiedRules } from './specifiedRules'; -/** Spec Section: "Executable Definitions" */ +// Spec Section: "Executable Definitions" export { ExecutableDefinitionsRule } from './rules/ExecutableDefinitionsRule'; -/** Spec Section: "Field Selections on Objects, Interfaces, and Unions Types" */ +// Spec Section: "Field Selections on Objects, Interfaces, and Unions Types" export { FieldsOnCorrectTypeRule } from './rules/FieldsOnCorrectTypeRule'; -/** Spec Section: "Fragments on Composite Types" */ +// Spec Section: "Fragments on Composite Types" export { FragmentsOnCompositeTypesRule } from './rules/FragmentsOnCompositeTypesRule'; -/** Spec Section: "Argument Names" */ +// Spec Section: "Argument Names" export { KnownArgumentNamesRule } from './rules/KnownArgumentNamesRule'; -/** Spec Section: "Directives Are Defined" */ +// Spec Section: "Directives Are Defined" export { KnownDirectivesRule } from './rules/KnownDirectivesRule'; -/** Spec Section: "Fragment spread target defined" */ +// Spec Section: "Fragment spread target defined" export { KnownFragmentNamesRule } from './rules/KnownFragmentNamesRule'; -/** Spec Section: "Fragment Spread Type Existence" */ +// Spec Section: "Fragment Spread Type Existence" export { KnownTypeNamesRule } from './rules/KnownTypeNamesRule'; -/** Spec Section: "Lone Anonymous Operation" */ +// Spec Section: "Lone Anonymous Operation" export { LoneAnonymousOperationRule } from './rules/LoneAnonymousOperationRule'; -/** Spec Section: "Fragments must not form cycles" */ +// Spec Section: "Fragments must not form cycles" export { NoFragmentCyclesRule } from './rules/NoFragmentCyclesRule'; -/** Spec Section: "All Variable Used Defined" */ +// Spec Section: "All Variable Used Defined" export { NoUndefinedVariablesRule } from './rules/NoUndefinedVariablesRule'; -/** Spec Section: "Fragments must be used" */ +// Spec Section: "Fragments must be used" export { NoUnusedFragmentsRule } from './rules/NoUnusedFragmentsRule'; -/** Spec Section: "All Variables Used" */ +// Spec Section: "All Variables Used" export { NoUnusedVariablesRule } from './rules/NoUnusedVariablesRule'; -/** Spec Section: "Field Selection Merging" */ +// Spec Section: "Field Selection Merging" export { OverlappingFieldsCanBeMergedRule } from './rules/OverlappingFieldsCanBeMergedRule'; -/** Spec Section: "Fragment spread is possible" */ +// Spec Section: "Fragment spread is possible" export { PossibleFragmentSpreadsRule } from './rules/PossibleFragmentSpreadsRule'; -/** Spec Section: "Argument Optionality" */ +// Spec Section: "Argument Optionality" export { ProvidedRequiredArgumentsRule } from './rules/ProvidedRequiredArgumentsRule'; -/** Spec Section: "Leaf Field Selections" */ +// Spec Section: "Leaf Field Selections" export { ScalarLeafsRule } from './rules/ScalarLeafsRule'; -/** Spec Section: "Subscriptions with Single Root Field" */ +// Spec Section: "Subscriptions with Single Root Field" export { SingleFieldSubscriptionsRule } from './rules/SingleFieldSubscriptionsRule'; -/** Spec Section: "Argument Uniqueness" */ +// Spec Section: "Argument Uniqueness" export { UniqueArgumentNamesRule } from './rules/UniqueArgumentNamesRule'; -/** Spec Section: "Directives Are Unique Per Location" */ +// Spec Section: "Directives Are Unique Per Location" export { UniqueDirectivesPerLocationRule } from './rules/UniqueDirectivesPerLocationRule'; -/** Spec Section: "Fragment Name Uniqueness" */ +// Spec Section: "Fragment Name Uniqueness" export { UniqueFragmentNamesRule } from './rules/UniqueFragmentNamesRule'; -/** Spec Section: "Input Object Field Uniqueness" */ +// Spec Section: "Input Object Field Uniqueness" export { UniqueInputFieldNamesRule } from './rules/UniqueInputFieldNamesRule'; -/** Spec Section: "Operation Name Uniqueness" */ +// Spec Section: "Operation Name Uniqueness" export { UniqueOperationNamesRule } from './rules/UniqueOperationNamesRule'; -/** Spec Section: "Variable Uniqueness" */ +// Spec Section: "Variable Uniqueness" export { UniqueVariableNamesRule } from './rules/UniqueVariableNamesRule'; -/** Spec Section: "Values Type Correctness" */ +// Spec Section: "Values Type Correctness" export { ValuesOfCorrectTypeRule } from './rules/ValuesOfCorrectTypeRule'; -/** Spec Section: "Variables are Input Types" */ +// Spec Section: "Variables are Input Types" export { VariablesAreInputTypesRule } from './rules/VariablesAreInputTypesRule'; -/** Spec Section: "All Variable Usages Are Allowed" */ +// Spec Section: "All Variable Usages Are Allowed" export { VariablesInAllowedPositionRule } from './rules/VariablesInAllowedPositionRule'; -/** SDL-specific validation rules */ +// SDL-specific validation rules export { LoneSchemaDefinitionRule } from './rules/LoneSchemaDefinitionRule'; export { UniqueOperationTypesRule } from './rules/UniqueOperationTypesRule'; export { UniqueTypeNamesRule } from './rules/UniqueTypeNamesRule'; @@ -94,6 +94,6 @@ export { UniqueArgumentDefinitionNamesRule } from './rules/UniqueArgumentDefinit export { UniqueDirectiveNamesRule } from './rules/UniqueDirectiveNamesRule'; export { PossibleTypeExtensionsRule } from './rules/PossibleTypeExtensionsRule'; -/** Optional rules not defined by the GraphQL Specification */ +// Optional rules not defined by the GraphQL Specification export { NoDeprecatedCustomRule } from './rules/custom/NoDeprecatedCustomRule'; export { NoSchemaIntrospectionCustomRule } from './rules/custom/NoSchemaIntrospectionCustomRule';