Skip to content

Commit

Permalink
Synchronise and fix styling of "index.js" files (#1826)
Browse files Browse the repository at this point in the history
  • Loading branch information
IvanGoncharov committed Apr 23, 2019
1 parent a9e87ce commit 86f6e82
Show file tree
Hide file tree
Showing 7 changed files with 77 additions and 60 deletions.
5 changes: 4 additions & 1 deletion src/error/index.js
Expand Up @@ -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';
4 changes: 2 additions & 2 deletions src/execution/index.js
Expand Up @@ -13,6 +13,6 @@ export {
defaultTypeResolver,
responsePathAsArray,
} from './execute';
export { getDirectiveValues } from './values';

export type { ExecutionArgs, ExecutionResult } from './execute';

export { getDirectiveValues } from './values';
91 changes: 46 additions & 45 deletions src/index.js
Expand Up @@ -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,
Expand All @@ -47,10 +48,7 @@ export {
GraphQLInputObjectType,
GraphQLList,
GraphQLNonNull,
GraphQLDirective,
// "Enum" of Type Kinds
TypeKind,
// Scalars
// Standard GraphQL Scalars
specifiedScalarTypes,
GraphQLInt,
GraphQLFloat,
Expand All @@ -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,
Expand All @@ -78,6 +74,10 @@ export {
__InputValue,
__EnumValue,
__TypeKind,
// Meta-field definitions.
SchemaMetaFieldDef,
TypeMetaFieldDef,
TypeNameMetaFieldDef,
// Predicates
isSchema,
isDirective,
Expand Down Expand Up @@ -143,6 +143,7 @@ export type {
GraphQLNamedType,
Thunk,
GraphQLSchemaConfig,
GraphQLDirectiveConfig,
GraphQLArgument,
GraphQLArgumentConfig,
GraphQLEnumTypeConfig,
Expand All @@ -168,7 +169,6 @@ export type {
GraphQLScalarTypeConfig,
GraphQLTypeResolver,
GraphQLUnionTypeConfig,
GraphQLDirectiveConfig,
GraphQLScalarSerializer,
GraphQLScalarValueParser,
GraphQLScalarLiteralParser,
Expand All @@ -180,6 +180,7 @@ export {
getLocation,
// Lex
createLexer,
TokenKind,
// Parse
parse,
parseValue,
Expand All @@ -191,10 +192,9 @@ export {
visitInParallel,
visitWithTypeInfo,
getVisitFn,
BREAK,
Kind,
TokenKind,
DirectiveLocation,
BREAK,
// Predicates
isDefinitionNode,
isExecutableDefinitionNode,
Expand All @@ -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,
Expand Down Expand Up @@ -274,9 +278,6 @@ export type {
UnionTypeExtensionNode,
EnumTypeExtensionNode,
InputObjectTypeExtensionNode,
KindEnum,
TokenKindEnum,
DirectiveLocationEnum,
} from './language';

// Execute GraphQL queries.
Expand All @@ -292,7 +293,7 @@ export type { ExecutionArgs, ExecutionResult } from './execution';

export { subscribe, createSourceEventStream } from './subscription';

// Validate GraphQL queries.
// Validate GraphQL documents.
export {
validate,
ValidationContext,
Expand Down Expand Up @@ -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,
Expand All @@ -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.
Expand All @@ -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.
Expand Down Expand Up @@ -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';
13 changes: 9 additions & 4 deletions src/language/index.js
Expand Up @@ -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,
Expand All @@ -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,
Expand Down
10 changes: 7 additions & 3 deletions src/type/index.js
Expand Up @@ -93,7 +93,9 @@ export type { GraphQLDirectiveConfig } from './directives';

// Common built-in scalar instances.
export {
// Predicate
isSpecifiedScalarType,
// Standard GraphQL Scalars
specifiedScalarTypes,
GraphQLInt,
GraphQLFloat,
Expand All @@ -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,
Expand All @@ -116,6 +117,8 @@ export {
__InputValue,
__EnumValue,
__TypeKind,
// "Enum" of Type Kinds
TypeKind,
// Meta-field definitions.
SchemaMetaFieldDef,
TypeMetaFieldDef,
Expand Down Expand Up @@ -163,4 +166,5 @@ export type {
GraphQLScalarLiteralParser,
} from './definition';

// Validate GraphQL schema.
export { validateSchema, assertValidSchema } from './validate';
13 changes: 8 additions & 5 deletions src/utilities/index.js
Expand Up @@ -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,
Expand All @@ -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.
Expand All @@ -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';
Expand Down Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions src/validation/index.js
Expand Up @@ -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"
Expand Down

0 comments on commit 86f6e82

Please sign in to comment.