Skip to content

Commit 5c9946b

Browse files
Sort imports in all JS files (#2059)
1 parent fc4058d commit 5c9946b

File tree

184 files changed

+831
-435
lines changed

Some content is hidden

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

184 files changed

+831
-435
lines changed

src/__tests__/starWarsIntrospection-test.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,11 @@
22

33
import { expect } from 'chai';
44
import { describe, it } from 'mocha';
5-
import { StarWarsSchema } from './starWarsSchema';
5+
66
import { graphqlSync } from '../graphql';
77

8+
import { StarWarsSchema } from './starWarsSchema';
9+
810
describe('Star Wars Introspection Tests', () => {
911
describe('Basic Introspection', () => {
1012
it('Allows querying the schema for types', () => {

src/__tests__/starWarsQuery-test.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,11 @@
22

33
import { expect } from 'chai';
44
import { describe, it } from 'mocha';
5-
import { StarWarsSchema } from './starWarsSchema';
5+
66
import { graphql } from '../graphql';
77

8+
import { StarWarsSchema } from './starWarsSchema';
9+
810
describe('Star Wars Query Tests', () => {
911
describe('Basic Queries', () => {
1012
it('Correctly identifies R2-D2 as the hero of the Star Wars Saga', async () => {

src/__tests__/starWarsValidation-test.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,14 @@
22

33
import { expect } from 'chai';
44
import { describe, it } from 'mocha';
5-
import { StarWarsSchema } from './starWarsSchema';
6-
import { Source } from '../language/source';
5+
76
import { parse } from '../language/parser';
7+
import { Source } from '../language/source';
8+
89
import { validate } from '../validation/validate';
910

11+
import { StarWarsSchema } from './starWarsSchema';
12+
1013
/**
1114
* Helper function to test a query and the expected response.
1215
*/

src/__tests__/version-test.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
import { expect } from 'chai';
44
import { describe, it } from 'mocha';
5+
56
import { version, versionInfo } from '../version';
67

78
describe('Version', () => {

src/error/GraphQLError.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
// @flow strict
22

33
import isObjectLike from '../jsutils/isObjectLike';
4+
45
import { type ASTNode } from '../language/ast';
56
import { type Source } from '../language/source';
67
import { type SourceLocation, getLocation } from '../language/location';

src/error/__tests__/GraphQLError-test.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import { describe, it } from 'mocha';
55

66
import dedent from '../../jsutils/dedent';
77
import invariant from '../../jsutils/invariant';
8+
89
import {
910
Kind,
1011
parse,

src/error/formatError.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
// @flow strict
22

33
import invariant from '../jsutils/invariant';
4-
import { type GraphQLError } from './GraphQLError';
4+
55
import { type SourceLocation } from '../language/location';
66

7+
import { type GraphQLError } from './GraphQLError';
8+
79
/**
810
* Given a GraphQLError, format it according to the rules described by the
911
* Response Format, Errors section of the GraphQL Specification.

src/error/locatedError.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
// @flow strict
22

3-
import { GraphQLError } from './GraphQLError';
43
import { type ASTNode } from '../language/ast';
54

5+
import { GraphQLError } from './GraphQLError';
6+
67
/**
78
* Given an arbitrary Error, presumably thrown while attempting to execute a
89
* GraphQL operation, produce a new GraphQLError aware of the location in the

src/error/syntaxError.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
// @flow strict
22

33
import { type Source } from '../language/source';
4+
45
import { GraphQLError } from './GraphQLError';
56

67
/**

src/execution/__tests__/abstract-promise-test.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
import { expect } from 'chai';
44
import { describe, it } from 'mocha';
5+
56
import {
67
graphql,
78
GraphQLSchema,

src/execution/__tests__/abstract-test.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
import { expect } from 'chai';
44
import { describe, it } from 'mocha';
5+
56
import {
67
graphqlSync,
78
GraphQLSchema,

src/execution/__tests__/directives-test.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
11
// @flow strict
22

33
import { expect } from 'chai';
4-
import { execute } from '../execute';
54
import { describe, it } from 'mocha';
5+
66
import { parse } from '../../language';
77
import { GraphQLSchema, GraphQLObjectType, GraphQLString } from '../../type';
88

9+
import { execute } from '../execute';
10+
911
const schema = new GraphQLSchema({
1012
query: new GraphQLObjectType({
1113
name: 'TestType',

src/execution/__tests__/executor-test.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,10 @@
22

33
import { expect } from 'chai';
44
import { describe, it } from 'mocha';
5+
56
import inspect from '../../jsutils/inspect';
67
import invariant from '../../jsutils/invariant';
7-
import { execute } from '../execute';
8+
89
import { Kind, parse } from '../../language';
910
import {
1011
GraphQLSchema,
@@ -17,6 +18,8 @@ import {
1718
GraphQLNonNull,
1819
} from '../../type';
1920

21+
import { execute } from '../execute';
22+
2023
describe('Execute: Handles basic execution tasks', () => {
2124
it('throws if no document is provided', () => {
2225
const schema = new GraphQLSchema({

src/execution/__tests__/lists-test.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
import { expect } from 'chai';
44
import { describe, it } from 'mocha';
5-
import { execute } from '../execute';
5+
66
import { parse } from '../../language';
77
import {
88
GraphQLSchema,
@@ -13,6 +13,8 @@ import {
1313
GraphQLNonNull,
1414
} from '../../type';
1515

16+
import { execute } from '../execute';
17+
1618
// resolved() is shorthand for Promise.resolve()
1719
const resolved = Promise.resolve.bind(Promise);
1820

src/execution/__tests__/mutations-test.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,12 @@
22

33
import { expect } from 'chai';
44
import { describe, it } from 'mocha';
5-
import { execute } from '../execute';
5+
66
import { parse } from '../../language';
77
import { GraphQLSchema, GraphQLObjectType, GraphQLInt } from '../../type';
88

9+
import { execute } from '../execute';
10+
911
class NumberHolder {
1012
theNumber: number;
1113

src/execution/__tests__/nonnull-test.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,17 @@
22

33
import { expect } from 'chai';
44
import { describe, it } from 'mocha';
5-
import { execute } from '../execute';
5+
66
import { parse } from '../../language';
7-
import { buildSchema } from '../../utilities/buildASTSchema';
87
import {
98
GraphQLSchema,
109
GraphQLObjectType,
1110
GraphQLString,
1211
GraphQLNonNull,
1312
} from '../../type';
13+
import { buildSchema } from '../../utilities/buildASTSchema';
14+
15+
import { execute } from '../execute';
1416

1517
const syncError = new Error('sync');
1618
const syncNonNullError = new Error('syncNonNull');

src/execution/__tests__/schema-test.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
import { expect } from 'chai';
44
import { describe, it } from 'mocha';
55

6-
import { execute } from '../execute';
76
import { parse } from '../../language';
7+
88
import {
99
GraphQLSchema,
1010
GraphQLObjectType,
@@ -16,6 +16,8 @@ import {
1616
GraphQLID,
1717
} from '../../type';
1818

19+
import { execute } from '../execute';
20+
1921
describe('Execute: Handles execution with a complex schema', () => {
2022
it('executes using a schema', () => {
2123
const BlogImage = new GraphQLObjectType({

src/execution/__tests__/sync-test.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,13 @@
22

33
import { expect } from 'chai';
44
import { describe, it } from 'mocha';
5-
import { graphqlSync } from '../../graphql';
6-
import { execute } from '../execute';
5+
76
import { parse } from '../../language';
87
import { validate } from '../../validation/validate';
98
import { GraphQLSchema, GraphQLObjectType, GraphQLString } from '../../type';
9+
import { graphqlSync } from '../../graphql';
10+
11+
import { execute } from '../execute';
1012

1113
describe('Execute: synchronously when possible', () => {
1214
const schema = new GraphQLSchema({

src/execution/__tests__/union-interface-test.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
import { expect } from 'chai';
44
import { describe, it } from 'mocha';
55

6-
import { execute } from '../execute';
76
import { parse } from '../../language';
87
import {
98
GraphQLSchema,
@@ -15,6 +14,8 @@ import {
1514
GraphQLBoolean,
1615
} from '../../type';
1716

17+
import { execute } from '../execute';
18+
1819
class Dog {
1920
name: string;
2021
barks: boolean;

src/execution/__tests__/variables-test.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
// @flow strict
22

3-
import inspect from '../../jsutils/inspect';
43
import { expect } from 'chai';
54
import { describe, it } from 'mocha';
6-
import { execute } from '../execute';
5+
6+
import inspect from '../../jsutils/inspect';
7+
78
import { parse } from '../../language';
89
import {
910
GraphQLSchema,
@@ -16,6 +17,8 @@ import {
1617
GraphQLEnumType,
1718
} from '../../type';
1819

20+
import { execute } from '../execute';
21+
1922
const TestComplexScalar = new GraphQLScalarType({
2023
name: 'ComplexScalar',
2124
serialize(value) {

src/execution/execute.js

Lines changed: 35 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,45 @@
11
// @flow strict
22

33
import { forEach, isCollection } from 'iterall';
4-
import { GraphQLError } from '../error/GraphQLError';
5-
import { locatedError } from '../error/locatedError';
4+
65
import inspect from '../jsutils/inspect';
6+
import memoize3 from '../jsutils/memoize3';
77
import invariant from '../jsutils/invariant';
88
import isInvalid from '../jsutils/isInvalid';
99
import isNullish from '../jsutils/isNullish';
1010
import isPromise from '../jsutils/isPromise';
11+
import { type ObjMap } from '../jsutils/ObjMap';
1112
import isObjectLike from '../jsutils/isObjectLike';
12-
import memoize3 from '../jsutils/memoize3';
13-
import promiseForObject from '../jsutils/promiseForObject';
1413
import promiseReduce from '../jsutils/promiseReduce';
15-
import { type ObjMap } from '../jsutils/ObjMap';
14+
import promiseForObject from '../jsutils/promiseForObject';
1615
import { type PromiseOrValue } from '../jsutils/PromiseOrValue';
1716
import { type Path, addPath, pathToArray } from '../jsutils/Path';
1817

19-
import { getOperationRootType } from '../utilities/getOperationRootType';
20-
import { typeFromAST } from '../utilities/typeFromAST';
18+
import { GraphQLError } from '../error/GraphQLError';
19+
import { locatedError } from '../error/locatedError';
20+
2121
import { Kind } from '../language/kinds';
2222
import {
23-
getVariableValues,
24-
getArgumentValues,
25-
getDirectiveValues,
26-
} from './values';
23+
type DocumentNode,
24+
type OperationDefinitionNode,
25+
type SelectionSetNode,
26+
type FieldNode,
27+
type FragmentSpreadNode,
28+
type InlineFragmentNode,
29+
type FragmentDefinitionNode,
30+
} from '../language/ast';
31+
32+
import { assertValidSchema } from '../type/validate';
33+
import { type GraphQLSchema } from '../type/schema';
34+
import {
35+
SchemaMetaFieldDef,
36+
TypeMetaFieldDef,
37+
TypeNameMetaFieldDef,
38+
} from '../type/introspection';
39+
import {
40+
GraphQLIncludeDirective,
41+
GraphQLSkipDirective,
42+
} from '../type/directives';
2743
import {
2844
type GraphQLObjectType,
2945
type GraphQLOutputType,
@@ -40,26 +56,15 @@ import {
4056
isListType,
4157
isNonNullType,
4258
} from '../type/definition';
43-
import { type GraphQLSchema } from '../type/schema';
44-
import {
45-
SchemaMetaFieldDef,
46-
TypeMetaFieldDef,
47-
TypeNameMetaFieldDef,
48-
} from '../type/introspection';
49-
import {
50-
GraphQLIncludeDirective,
51-
GraphQLSkipDirective,
52-
} from '../type/directives';
53-
import { assertValidSchema } from '../type/validate';
59+
60+
import { typeFromAST } from '../utilities/typeFromAST';
61+
import { getOperationRootType } from '../utilities/getOperationRootType';
62+
5463
import {
55-
type DocumentNode,
56-
type OperationDefinitionNode,
57-
type SelectionSetNode,
58-
type FieldNode,
59-
type FragmentSpreadNode,
60-
type InlineFragmentNode,
61-
type FragmentDefinitionNode,
62-
} from '../language/ast';
64+
getVariableValues,
65+
getArgumentValues,
66+
getDirectiveValues,
67+
} from './values';
6368

6469
/**
6570
* Terminology

0 commit comments

Comments
 (0)