Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TS: switch all imports to type imports #3118

Merged
merged 1 commit into from May 20, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 4 additions & 4 deletions src/error/GraphQLError.d.ts
@@ -1,8 +1,8 @@
import { Maybe } from '../jsutils/Maybe';
import type { Maybe } from '../jsutils/Maybe';

import { ASTNode } from '../language/ast';
import { Source } from '../language/source';
import { SourceLocation } from '../language/location';
import type { ASTNode } from '../language/ast';
import type { Source } from '../language/source';
import type { SourceLocation } from '../language/location';

/**
* A GraphQLError describes an Error found during the parse, validate, or
Expand Down
4 changes: 2 additions & 2 deletions src/error/formatError.d.ts
@@ -1,6 +1,6 @@
import { SourceLocation } from '../language/location';
import type { SourceLocation } from '../language/location';

import { GraphQLError } from './GraphQLError';
import type { GraphQLError } from './GraphQLError';

/**
* Given a GraphQLError, format it according to the rules described by the
Expand Down
6 changes: 3 additions & 3 deletions src/error/locatedError.d.ts
@@ -1,8 +1,8 @@
import { Maybe } from '../jsutils/Maybe';
import type { Maybe } from '../jsutils/Maybe';

import { ASTNode } from '../language/ast';
import type { ASTNode } from '../language/ast';

import { GraphQLError } from './GraphQLError';
import type { GraphQLError } from './GraphQLError';

/**
* Given an arbitrary value, presumably thrown while attempting to execute a
Expand Down
4 changes: 2 additions & 2 deletions src/error/syntaxError.d.ts
@@ -1,6 +1,6 @@
import { Source } from '../language/source';
import type { Source } from '../language/source';

import { GraphQLError } from './GraphQLError';
import type { GraphQLError } from './GraphQLError';

/**
* Produces a GraphQLError representing a syntax error, containing useful
Expand Down
18 changes: 9 additions & 9 deletions src/execution/execute.d.ts
@@ -1,21 +1,21 @@
import { Maybe } from '../jsutils/Maybe';
import { ObjMap } from '../jsutils/ObjMap';
import type { Maybe } from '../jsutils/Maybe';
import type { ObjMap } from '../jsutils/ObjMap';

import { PromiseOrValue } from '../jsutils/PromiseOrValue';
import { Path } from '../jsutils/Path';
import type { PromiseOrValue } from '../jsutils/PromiseOrValue';
import type { Path } from '../jsutils/Path';

import { GraphQLError } from '../error/GraphQLError';
import { GraphQLFormattedError } from '../error/formatError';
import type { GraphQLError } from '../error/GraphQLError';
import type { GraphQLFormattedError } from '../error/formatError';

import {
import type {
DocumentNode,
OperationDefinitionNode,
SelectionSetNode,
FieldNode,
FragmentDefinitionNode,
} from '../language/ast';
import { GraphQLSchema } from '../type/schema';
import {
import type { GraphQLSchema } from '../type/schema';
import type {
GraphQLField,
GraphQLFieldResolver,
GraphQLResolveInfo,
Expand Down
14 changes: 7 additions & 7 deletions src/execution/values.d.ts
@@ -1,16 +1,16 @@
import { Maybe } from '../jsutils/Maybe';
import { ObjMap } from '../jsutils/ObjMap';
import type { Maybe } from '../jsutils/Maybe';
import type { ObjMap } from '../jsutils/ObjMap';

import { GraphQLError } from '../error/GraphQLError';
import {
import type { GraphQLError } from '../error/GraphQLError';
import type {
FieldNode,
DirectiveNode,
VariableDefinitionNode,
} from '../language/ast';

import { GraphQLDirective } from '../type/directives';
import { GraphQLSchema } from '../type/schema';
import { GraphQLField } from '../type/definition';
import type { GraphQLDirective } from '../type/directives';
import type { GraphQLSchema } from '../type/schema';
import type { GraphQLField } from '../type/definition';

type CoercedVariableValues =
| { errors: ReadonlyArray<GraphQLError>; coerced?: never }
Expand Down
13 changes: 8 additions & 5 deletions src/graphql.d.ts
@@ -1,9 +1,12 @@
import { Maybe } from './jsutils/Maybe';
import type { Maybe } from './jsutils/Maybe';

import { Source } from './language/source';
import { GraphQLSchema } from './type/schema';
import { GraphQLFieldResolver, GraphQLTypeResolver } from './type/definition';
import { ExecutionResult } from './execution/execute';
import type { Source } from './language/source';
import type { GraphQLSchema } from './type/schema';
import type {
GraphQLFieldResolver,
GraphQLTypeResolver,
} from './type/definition';
import type { ExecutionResult } from './execution/execute';

/**
* This is the primary entry point function for fulfilling GraphQL operations
Expand Down
4 changes: 2 additions & 2 deletions src/language/ast.d.ts
@@ -1,5 +1,5 @@
import { Source } from './source';
import { TokenKindEnum } from './tokenKind';
import type { Source } from './source';
import type { TokenKindEnum } from './tokenKind';

/**
* Contains a range of UTF-8 character offsets and token references that
Expand Down
6 changes: 3 additions & 3 deletions src/language/lexer.d.ts
@@ -1,6 +1,6 @@
import { Token } from './ast';
import { Source } from './source';
import { TokenKindEnum } from './tokenKind';
import type { Token } from './ast';
import type { Source } from './source';
import type { TokenKindEnum } from './tokenKind';

/**
* Given a Source object, this returns a Lexer for that source.
Expand Down
2 changes: 1 addition & 1 deletion src/language/location.d.ts
@@ -1,4 +1,4 @@
import { Source } from './source';
import type { Source } from './source';

/**
* Represents a location in a Source.
Expand Down
12 changes: 6 additions & 6 deletions src/language/parser.d.ts
@@ -1,7 +1,7 @@
import { Maybe } from '../jsutils/Maybe';
import { GraphQLError } from '../error/GraphQLError';
import type { Maybe } from '../jsutils/Maybe';
import type { GraphQLError } from '../error/GraphQLError';

import {
import type {
Token,
NameNode,
VariableNode,
Expand Down Expand Up @@ -53,9 +53,9 @@ import {
EnumTypeExtensionNode,
InputObjectTypeExtensionNode,
} from './ast';
import { TokenKindEnum } from './tokenKind';
import { Source } from './source';
import { Lexer } from './lexer';
import type { TokenKindEnum } from './tokenKind';
import type { Source } from './source';
import type { Lexer } from './lexer';
/**
* Configuration options to control parser behavior
*/
Expand Down
2 changes: 1 addition & 1 deletion src/language/predicates.d.ts
@@ -1,4 +1,4 @@
import {
import type {
ASTNode,
DefinitionNode,
ExecutableDefinitionNode,
Expand Down
6 changes: 3 additions & 3 deletions src/language/printLocation.d.ts
@@ -1,6 +1,6 @@
import { Location } from './ast';
import { Source } from './source';
import { SourceLocation } from './location';
import type { Location } from './ast';
import type { Source } from './source';
import type { SourceLocation } from './location';

/**
* Render a helpful description of the location in the GraphQL Source document.
Expand Down
2 changes: 1 addition & 1 deletion src/language/printer.d.ts
@@ -1,4 +1,4 @@
import { ASTNode } from './ast';
import type { ASTNode } from './ast';

/**
* Converts an AST into a string, using one set of reasonable
Expand Down
4 changes: 2 additions & 2 deletions src/language/visitor.d.ts
@@ -1,6 +1,6 @@
import { Maybe } from '../jsutils/Maybe';
import type { Maybe } from '../jsutils/Maybe';

import { ASTNode, ASTKindToNode } from './ast';
import type { ASTNode, ASTKindToNode } from './ast';

/**
* A visitor is provided to visit, it contains the collection of
Expand Down
2 changes: 1 addition & 1 deletion src/subscription/mapAsyncIterator.d.ts
@@ -1,4 +1,4 @@
import { PromiseOrValue } from '../jsutils/PromiseOrValue';
import type { PromiseOrValue } from '../jsutils/PromiseOrValue';

/**
* Given an AsyncIterable and a callback function, return an AsyncIterator
Expand Down
10 changes: 5 additions & 5 deletions src/subscription/subscribe.d.ts
@@ -1,9 +1,9 @@
import { Maybe } from '../jsutils/Maybe';
import type { Maybe } from '../jsutils/Maybe';

import { DocumentNode } from '../language/ast';
import { ExecutionResult } from '../execution/execute';
import { GraphQLSchema } from '../type/schema';
import { GraphQLFieldResolver } from '../type/definition';
import type { DocumentNode } from '../language/ast';
import type { ExecutionResult } from '../execution/execute';
import type { GraphQLSchema } from '../type/schema';
import type { GraphQLFieldResolver } from '../type/definition';

export interface SubscriptionArgs {
schema: GraphQLSchema;
Expand Down
15 changes: 6 additions & 9 deletions src/type/definition.d.ts
@@ -1,13 +1,10 @@
// FIXME
/* eslint-disable import/no-cycle */
import type { Maybe } from '../jsutils/Maybe';

import { Maybe } from '../jsutils/Maybe';
import type { PromiseOrValue } from '../jsutils/PromiseOrValue';
import type { Path } from '../jsutils/Path';
import type { ObjMap } from '../jsutils/ObjMap';

import { PromiseOrValue } from '../jsutils/PromiseOrValue';
import { Path } from '../jsutils/Path';
import { ObjMap } from '../jsutils/ObjMap';

import {
import type {
ScalarTypeDefinitionNode,
ObjectTypeDefinitionNode,
FieldDefinitionNode,
Expand All @@ -29,7 +26,7 @@ import {
InputObjectTypeExtensionNode,
} from '../language/ast';

import { GraphQLSchema } from './schema';
import type { GraphQLSchema } from './schema';

/**
* These are all of the possible kinds of types.
Expand Down
14 changes: 7 additions & 7 deletions src/type/directives.d.ts
@@ -1,12 +1,12 @@
// FIXME
/* eslint-disable import/no-cycle */
import type { Maybe } from '../jsutils/Maybe';

import { Maybe } from '../jsutils/Maybe';
import type { DirectiveDefinitionNode } from '../language/ast';
import type { DirectiveLocationEnum } from '../language/directiveLocation';

import { DirectiveDefinitionNode } from '../language/ast';
import { DirectiveLocationEnum } from '../language/directiveLocation';

import { GraphQLFieldConfigArgumentMap, GraphQLArgument } from './definition';
import type {
GraphQLFieldConfigArgumentMap,
GraphQLArgument,
} from './definition';

/**
* Test if the given value is a GraphQL directive.
Expand Down
2 changes: 1 addition & 1 deletion src/type/introspection.d.ts
@@ -1,4 +1,4 @@
import {
import type {
GraphQLObjectType,
GraphQLField,
GraphQLEnumType,
Expand Down
2 changes: 1 addition & 1 deletion src/type/scalars.d.ts
@@ -1,4 +1,4 @@
import { GraphQLScalarType, GraphQLNamedType } from './definition';
import type { GraphQLScalarType, GraphQLNamedType } from './definition';

export const GraphQLInt: GraphQLScalarType;
export const GraphQLFloat: GraphQLScalarType;
Expand Down
16 changes: 8 additions & 8 deletions src/type/schema.d.ts
@@ -1,13 +1,13 @@
// FIXME
/* eslint-disable import/no-cycle */
import type { Maybe } from '../jsutils/Maybe';
import type { ObjMap } from '../jsutils/ObjMap';

import { Maybe } from '../jsutils/Maybe';
import { ObjMap } from '../jsutils/ObjMap';
import type {
SchemaDefinitionNode,
SchemaExtensionNode,
} from '../language/ast';

import { SchemaDefinitionNode, SchemaExtensionNode } from '../language/ast';

import { GraphQLDirective } from './directives';
import {
import type { GraphQLDirective } from './directives';
import type {
GraphQLNamedType,
GraphQLAbstractType,
GraphQLObjectType,
Expand Down
4 changes: 2 additions & 2 deletions src/type/validate.d.ts
@@ -1,6 +1,6 @@
import { GraphQLError } from '../error/GraphQLError';
import type { GraphQLError } from '../error/GraphQLError';

import { GraphQLSchema } from './schema';
import type { GraphQLSchema } from './schema';

/**
* Implements the "Type Validation" sub-sections of the specification's
Expand Down
12 changes: 6 additions & 6 deletions src/utilities/TypeInfo.d.ts
@@ -1,10 +1,10 @@
import { Maybe } from '../jsutils/Maybe';
import type { Maybe } from '../jsutils/Maybe';

import { ASTVisitor } from '../language/visitor';
import { ASTNode, FieldNode } from '../language/ast';
import { GraphQLSchema } from '../type/schema';
import { GraphQLDirective } from '../type/directives';
import {
import type { ASTVisitor } from '../language/visitor';
import type { ASTNode, FieldNode } from '../language/ast';
import type { GraphQLSchema } from '../type/schema';
import type { GraphQLDirective } from '../type/directives';
import type {
GraphQLType,
GraphQLInputType,
GraphQLOutputType,
Expand Down
2 changes: 1 addition & 1 deletion src/utilities/assertValidName.d.ts
@@ -1,4 +1,4 @@
import { GraphQLError } from '../error/GraphQLError';
import type { GraphQLError } from '../error/GraphQLError';

/**
* Upholds the spec rules about naming.
Expand Down
6 changes: 3 additions & 3 deletions src/utilities/astFromValue.d.ts
@@ -1,7 +1,7 @@
import { Maybe } from '../jsutils/Maybe';
import type { Maybe } from '../jsutils/Maybe';

import { ValueNode } from '../language/ast';
import { GraphQLInputType } from '../type/definition';
import type { ValueNode } from '../language/ast';
import type { GraphQLInputType } from '../type/definition';

/**
* Produces a GraphQL Value AST given a JavaScript value.
Expand Down
11 changes: 7 additions & 4 deletions src/utilities/buildASTSchema.d.ts
@@ -1,7 +1,10 @@
import { DocumentNode } from '../language/ast';
import { Source } from '../language/source';
import { GraphQLSchema, GraphQLSchemaValidationOptions } from '../type/schema';
import { ParseOptions } from '../language/parser';
import type { DocumentNode } from '../language/ast';
import type { Source } from '../language/source';
import type {
GraphQLSchema,
GraphQLSchemaValidationOptions,
} from '../type/schema';
import type { ParseOptions } from '../language/parser';

export interface BuildSchemaOptions extends GraphQLSchemaValidationOptions {
/**
Expand Down
7 changes: 5 additions & 2 deletions src/utilities/buildClientSchema.d.ts
@@ -1,6 +1,9 @@
import { GraphQLSchema, GraphQLSchemaValidationOptions } from '../type/schema';
import type {
GraphQLSchema,
GraphQLSchemaValidationOptions,
} from '../type/schema';

import { IntrospectionQuery } from './getIntrospectionQuery';
import type { IntrospectionQuery } from './getIntrospectionQuery';

/**
* Build a GraphQLSchema for use by client tools.
Expand Down
4 changes: 2 additions & 2 deletions src/utilities/coerceInputValue.d.ts
@@ -1,5 +1,5 @@
import { GraphQLInputType } from '../type/definition';
import { GraphQLError } from '../error/GraphQLError';
import type { GraphQLInputType } from '../type/definition';
import type { GraphQLError } from '../error/GraphQLError';

type OnErrorCB = (
path: ReadonlyArray<string | number>,
Expand Down
2 changes: 1 addition & 1 deletion src/utilities/concatAST.d.ts
@@ -1,4 +1,4 @@
import { DocumentNode } from '../language/ast';
import type { DocumentNode } from '../language/ast';

/**
* Provided a collection of ASTs, presumably each from different files,
Expand Down
4 changes: 2 additions & 2 deletions src/utilities/extendSchema.d.ts
@@ -1,5 +1,5 @@
import { DocumentNode } from '../language/ast';
import {
import type { DocumentNode } from '../language/ast';
import type {
GraphQLSchemaValidationOptions,
GraphQLSchema,
GraphQLSchemaNormalizedConfig,
Expand Down
2 changes: 1 addition & 1 deletion src/utilities/findBreakingChanges.d.ts
@@ -1,4 +1,4 @@
import { GraphQLSchema } from '../type/schema';
import type { GraphQLSchema } from '../type/schema';

export const BreakingChangeType: {
TYPE_REMOVED: 'TYPE_REMOVED';
Expand Down