Skip to content

Commit d4ca247

Browse files
TS: switch all imports to type imports (#3118)
1 parent e591d0a commit d4ca247

File tree

83 files changed

+242
-220
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

83 files changed

+242
-220
lines changed

src/error/GraphQLError.d.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
import { Maybe } from '../jsutils/Maybe';
1+
import type { Maybe } from '../jsutils/Maybe';
22

3-
import { ASTNode } from '../language/ast';
4-
import { Source } from '../language/source';
5-
import { SourceLocation } from '../language/location';
3+
import type { ASTNode } from '../language/ast';
4+
import type { Source } from '../language/source';
5+
import type { SourceLocation } from '../language/location';
66

77
/**
88
* A GraphQLError describes an Error found during the parse, validate, or

src/error/formatError.d.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
import { SourceLocation } from '../language/location';
1+
import type { SourceLocation } from '../language/location';
22

3-
import { GraphQLError } from './GraphQLError';
3+
import type { GraphQLError } from './GraphQLError';
44

55
/**
66
* Given a GraphQLError, format it according to the rules described by the

src/error/locatedError.d.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
import { Maybe } from '../jsutils/Maybe';
1+
import type { Maybe } from '../jsutils/Maybe';
22

3-
import { ASTNode } from '../language/ast';
3+
import type { ASTNode } from '../language/ast';
44

5-
import { GraphQLError } from './GraphQLError';
5+
import type { GraphQLError } from './GraphQLError';
66

77
/**
88
* Given an arbitrary value, presumably thrown while attempting to execute a

src/error/syntaxError.d.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
import { Source } from '../language/source';
1+
import type { Source } from '../language/source';
22

3-
import { GraphQLError } from './GraphQLError';
3+
import type { GraphQLError } from './GraphQLError';
44

55
/**
66
* Produces a GraphQLError representing a syntax error, containing useful

src/execution/execute.d.ts

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,21 @@
1-
import { Maybe } from '../jsutils/Maybe';
2-
import { ObjMap } from '../jsutils/ObjMap';
1+
import type { Maybe } from '../jsutils/Maybe';
2+
import type { ObjMap } from '../jsutils/ObjMap';
33

4-
import { PromiseOrValue } from '../jsutils/PromiseOrValue';
5-
import { Path } from '../jsutils/Path';
4+
import type { PromiseOrValue } from '../jsutils/PromiseOrValue';
5+
import type { Path } from '../jsutils/Path';
66

7-
import { GraphQLError } from '../error/GraphQLError';
8-
import { GraphQLFormattedError } from '../error/formatError';
7+
import type { GraphQLError } from '../error/GraphQLError';
8+
import type { GraphQLFormattedError } from '../error/formatError';
99

10-
import {
10+
import type {
1111
DocumentNode,
1212
OperationDefinitionNode,
1313
SelectionSetNode,
1414
FieldNode,
1515
FragmentDefinitionNode,
1616
} from '../language/ast';
17-
import { GraphQLSchema } from '../type/schema';
18-
import {
17+
import type { GraphQLSchema } from '../type/schema';
18+
import type {
1919
GraphQLField,
2020
GraphQLFieldResolver,
2121
GraphQLResolveInfo,

src/execution/values.d.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
1-
import { Maybe } from '../jsutils/Maybe';
2-
import { ObjMap } from '../jsutils/ObjMap';
1+
import type { Maybe } from '../jsutils/Maybe';
2+
import type { ObjMap } from '../jsutils/ObjMap';
33

4-
import { GraphQLError } from '../error/GraphQLError';
5-
import {
4+
import type { GraphQLError } from '../error/GraphQLError';
5+
import type {
66
FieldNode,
77
DirectiveNode,
88
VariableDefinitionNode,
99
} from '../language/ast';
1010

11-
import { GraphQLDirective } from '../type/directives';
12-
import { GraphQLSchema } from '../type/schema';
13-
import { GraphQLField } from '../type/definition';
11+
import type { GraphQLDirective } from '../type/directives';
12+
import type { GraphQLSchema } from '../type/schema';
13+
import type { GraphQLField } from '../type/definition';
1414

1515
type CoercedVariableValues =
1616
| { errors: ReadonlyArray<GraphQLError>; coerced?: never }

src/graphql.d.ts

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
1-
import { Maybe } from './jsutils/Maybe';
1+
import type { Maybe } from './jsutils/Maybe';
22

3-
import { Source } from './language/source';
4-
import { GraphQLSchema } from './type/schema';
5-
import { GraphQLFieldResolver, GraphQLTypeResolver } from './type/definition';
6-
import { ExecutionResult } from './execution/execute';
3+
import type { Source } from './language/source';
4+
import type { GraphQLSchema } from './type/schema';
5+
import type {
6+
GraphQLFieldResolver,
7+
GraphQLTypeResolver,
8+
} from './type/definition';
9+
import type { ExecutionResult } from './execution/execute';
710

811
/**
912
* This is the primary entry point function for fulfilling GraphQL operations

src/language/ast.d.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import { Source } from './source';
2-
import { TokenKindEnum } from './tokenKind';
1+
import type { Source } from './source';
2+
import type { TokenKindEnum } from './tokenKind';
33

44
/**
55
* Contains a range of UTF-8 character offsets and token references that

src/language/lexer.d.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
import { Token } from './ast';
2-
import { Source } from './source';
3-
import { TokenKindEnum } from './tokenKind';
1+
import type { Token } from './ast';
2+
import type { Source } from './source';
3+
import type { TokenKindEnum } from './tokenKind';
44

55
/**
66
* Given a Source object, this returns a Lexer for that source.

src/language/location.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Source } from './source';
1+
import type { Source } from './source';
22

33
/**
44
* Represents a location in a Source.

0 commit comments

Comments
 (0)