Skip to content

Commit cffcec4

Browse files
Remove empty lines from '*.d.ts' files (#3119)
1 parent d4ca247 commit cffcec4

File tree

99 files changed

+4
-663
lines changed

Some content is hidden

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

99 files changed

+4
-663
lines changed

.eslintrc.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -665,6 +665,10 @@ overrides:
665665
'@typescript-eslint/space-before-function-paren': off
666666
'@typescript-eslint/space-infix-ops': off
667667
'@typescript-eslint/type-annotation-spacing': off
668+
- files: 'src/**/*.d.ts'
669+
rules:
670+
import/order: off
671+
import/newline-after-import: off
668672
- files: 'src/**/__*__/**'
669673
rules:
670674
node/no-unpublished-import: [error, { allowModules: ['chai', 'mocha'] }]

src/error/GraphQLError.d.ts

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
import type { Maybe } from '../jsutils/Maybe';
2-
32
import type { ASTNode } from '../language/ast';
43
import type { Source } from '../language/source';
54
import type { SourceLocation } from '../language/location';
6-
75
/**
86
* A GraphQLError describes an Error found during the parse, validate, or
97
* execute phases of performing a GraphQL operation. In addition to a message
@@ -20,7 +18,6 @@ export class GraphQLError extends Error {
2018
originalError?: Maybe<Error>,
2119
extensions?: Maybe<{ [key: string]: unknown }>,
2220
);
23-
2421
/**
2522
* A message describing the Error for debugging purposes.
2623
*
@@ -29,7 +26,6 @@ export class GraphQLError extends Error {
2926
* Note: should be treated as readonly, despite invariant usage.
3027
*/
3128
message: string;
32-
3329
/**
3430
* An array of { line, column } locations within the source GraphQL document
3531
* which correspond to this error.
@@ -41,45 +37,38 @@ export class GraphQLError extends Error {
4137
* Enumerable, and appears in the result of JSON.stringify().
4238
*/
4339
readonly locations: ReadonlyArray<SourceLocation> | undefined;
44-
4540
/**
4641
* An array describing the JSON-path into the execution response which
4742
* corresponds to this error. Only included for errors during execution.
4843
*
4944
* Enumerable, and appears in the result of JSON.stringify().
5045
*/
5146
readonly path: ReadonlyArray<string | number> | undefined;
52-
5347
/**
5448
* An array of GraphQL AST Nodes corresponding to this error.
5549
*/
5650
readonly nodes: ReadonlyArray<ASTNode> | undefined;
57-
5851
/**
5952
* The source GraphQL document corresponding to this error.
6053
*
6154
* Note that if this Error represents more than one node, the source may not
6255
* represent nodes after the first node.
6356
*/
6457
readonly source: Source | undefined;
65-
6658
/**
6759
* An array of character offsets within the source GraphQL document
6860
* which correspond to this error.
6961
*/
7062
readonly positions: ReadonlyArray<number> | undefined;
71-
7263
/**
7364
* The original error thrown from a field resolver during execution.
7465
*/
7566
readonly originalError: Maybe<Error>;
76-
7767
/**
7868
* Extension fields to add to the formatted error.
7969
*/
8070
readonly extensions: { [key: string]: unknown } | undefined;
8171
}
82-
8372
/**
8473
* Prints a GraphQLError to a string, representing useful location information
8574
* about the error's position in the source.

src/error/formatError.d.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,10 @@
11
import type { SourceLocation } from '../language/location';
2-
32
import type { GraphQLError } from './GraphQLError';
4-
53
/**
64
* Given a GraphQLError, format it according to the rules described by the
75
* Response Format, Errors section of the GraphQL Specification.
86
*/
97
export function formatError(error: GraphQLError): GraphQLFormattedError;
10-
118
/**
129
* @see https://github.com/graphql/graphql-spec/blob/master/spec/Section%207%20--%20Response.md#errors
1310
*/

src/error/locatedError.d.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11
import type { Maybe } from '../jsutils/Maybe';
2-
32
import type { ASTNode } from '../language/ast';
4-
53
import type { GraphQLError } from './GraphQLError';
6-
74
/**
85
* Given an arbitrary value, presumably thrown while attempting to execute a
96
* GraphQL operation, produce a new GraphQLError aware of the location in the

src/error/syntaxError.d.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
import type { Source } from '../language/source';
2-
32
import type { GraphQLError } from './GraphQLError';
4-
53
/**
64
* Produces a GraphQLError representing a syntax error, containing useful
75
* descriptive information about the syntax error's position in the source.

src/execution/execute.d.ts

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,9 @@
11
import type { Maybe } from '../jsutils/Maybe';
22
import type { ObjMap } from '../jsutils/ObjMap';
3-
43
import type { PromiseOrValue } from '../jsutils/PromiseOrValue';
54
import type { Path } from '../jsutils/Path';
6-
75
import type { GraphQLError } from '../error/GraphQLError';
86
import type { GraphQLFormattedError } from '../error/formatError';
9-
107
import type {
118
DocumentNode,
129
OperationDefinitionNode,
@@ -22,7 +19,6 @@ import type {
2219
GraphQLTypeResolver,
2320
GraphQLObjectType,
2421
} from '../type/definition';
25-
2622
/**
2723
* Terminology
2824
*
@@ -42,7 +38,6 @@ import type {
4238
* 2) fragment "spreads" e.g. "...c"
4339
* 3) inline fragment "spreads" e.g. "...on Type { a }"
4440
*/
45-
4641
/**
4742
* Data that must be available at all points during query execution.
4843
*
@@ -60,7 +55,6 @@ export interface ExecutionContext {
6055
typeResolver: GraphQLTypeResolver<any, any>;
6156
errors: Array<GraphQLError>;
6257
}
63-
6458
/**
6559
* The result of GraphQL execution.
6660
*
@@ -77,7 +71,6 @@ export interface ExecutionResult<
7771
data?: TData | null;
7872
extensions?: TExtensions;
7973
}
80-
8174
export interface FormattedExecutionResult<
8275
TData = { [key: string]: any },
8376
TExtensions = { [key: string]: any },
@@ -87,7 +80,6 @@ export interface FormattedExecutionResult<
8780
data?: TData | null;
8881
extensions?: TExtensions;
8982
}
90-
9183
export interface ExecutionArgs {
9284
schema: GraphQLSchema;
9385
document: DocumentNode;
@@ -98,7 +90,6 @@ export interface ExecutionArgs {
9890
fieldResolver?: Maybe<GraphQLFieldResolver<any, any>>;
9991
typeResolver?: Maybe<GraphQLTypeResolver<any, any>>;
10092
}
101-
10293
/**
10394
* Implements the "Evaluating requests" section of the GraphQL specification.
10495
*
@@ -110,14 +101,12 @@ export interface ExecutionArgs {
110101
* a GraphQLError will be thrown immediately explaining the invalid input.
111102
*/
112103
export function execute(args: ExecutionArgs): PromiseOrValue<ExecutionResult>;
113-
114104
/**
115105
* Also implements the "Evaluating requests" section of the GraphQL specification.
116106
* However, it guarantees to complete synchronously (or throw an error) assuming
117107
* that all field resolvers are also synchronous.
118108
*/
119109
export function executeSync(args: ExecutionArgs): ExecutionResult;
120-
121110
/**
122111
* Essential assertions before executing to provide developer feedback for
123112
* improper use of the GraphQL library.
@@ -129,7 +118,6 @@ export function assertValidExecutionArguments(
129118
document: DocumentNode,
130119
rawVariableValues: Maybe<{ [key: string]: unknown }>,
131120
): void;
132-
133121
/**
134122
* Constructs a ExecutionContext object from the arguments passed to
135123
* execute, which we will pass throughout the other execution methods.
@@ -148,7 +136,6 @@ export function buildExecutionContext(
148136
fieldResolver: Maybe<GraphQLFieldResolver<unknown, unknown>>,
149137
typeResolver?: Maybe<GraphQLTypeResolver<unknown, unknown>>,
150138
): ReadonlyArray<GraphQLError> | ExecutionContext;
151-
152139
/**
153140
* Given a selectionSet, adds all of the fields in that selection to
154141
* the passed in map of fields, and returns it at the end.
@@ -166,7 +153,6 @@ export function collectFields(
166153
fields: ObjMap<Array<FieldNode>>,
167154
visitedFragmentNames: ObjMap<boolean>,
168155
): ObjMap<Array<FieldNode>>;
169-
170156
/**
171157
* @internal
172158
*/
@@ -177,7 +163,6 @@ export function buildResolveInfo(
177163
parentType: GraphQLObjectType,
178164
path: Path,
179165
): GraphQLResolveInfo;
180-
181166
/**
182167
* If a resolveType function is not given, then a default resolve behavior is
183168
* used which attempts two strategies:
@@ -189,15 +174,13 @@ export function buildResolveInfo(
189174
* isTypeOf for the object being coerced, returning the first type that matches.
190175
*/
191176
export const defaultTypeResolver: GraphQLTypeResolver<unknown, unknown>;
192-
193177
/**
194178
* If a resolve function is not given, then a default resolve behavior is used
195179
* which takes the property of the source object of the same name as the field
196180
* and returns it as the result, or if it's a function, returns the result
197181
* of calling that function while passing along args and context value.
198182
*/
199183
export const defaultFieldResolver: GraphQLFieldResolver<unknown, unknown>;
200-
201184
/**
202185
* This method looks up the field on the given type definition.
203186
* It has special casing for the three introspection fields,

src/execution/index.d.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
export { pathToArray as responsePathAsArray } from '../jsutils/Path';
2-
32
export {
43
execute,
54
executeSync,
@@ -9,5 +8,4 @@ export {
98
ExecutionResult,
109
FormattedExecutionResult,
1110
} from './execute';
12-
1311
export { getDirectiveValues } from './values';

src/execution/values.d.ts

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,17 @@
11
import type { Maybe } from '../jsutils/Maybe';
22
import type { ObjMap } from '../jsutils/ObjMap';
3-
43
import type { GraphQLError } from '../error/GraphQLError';
54
import type {
65
FieldNode,
76
DirectiveNode,
87
VariableDefinitionNode,
98
} from '../language/ast';
10-
119
import type { GraphQLDirective } from '../type/directives';
1210
import type { GraphQLSchema } from '../type/schema';
1311
import type { GraphQLField } from '../type/definition';
14-
1512
type CoercedVariableValues =
1613
| { errors: ReadonlyArray<GraphQLError>; coerced?: never }
1714
| { errors?: never; coerced: { [key: string]: unknown } };
18-
1915
/**
2016
* Prepares an object map of variableValues of the correct type based on the
2117
* provided variable definitions and arbitrary input. If the input cannot be
@@ -31,7 +27,6 @@ export function getVariableValues(
3127
inputs: { [key: string]: unknown },
3228
options?: { maxErrors?: number },
3329
): CoercedVariableValues;
34-
3530
/**
3631
* Prepares an object map of argument values given a list of argument
3732
* definitions and list of argument AST nodes.
@@ -45,7 +40,6 @@ export function getArgumentValues(
4540
node: FieldNode | DirectiveNode,
4641
variableValues?: Maybe<ObjMap<unknown>>,
4742
): { [key: string]: unknown };
48-
4943
/**
5044
* Prepares an object map of argument values given a directive definition
5145
* and a AST node which may contain directives. Optionally also accepts a map

src/graphql.d.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,11 @@
11
import type { Maybe } from './jsutils/Maybe';
2-
32
import type { Source } from './language/source';
43
import type { GraphQLSchema } from './type/schema';
54
import type {
65
GraphQLFieldResolver,
76
GraphQLTypeResolver,
87
} from './type/definition';
98
import type { ExecutionResult } from './execution/execute';
10-
119
/**
1210
* This is the primary entry point function for fulfilling GraphQL operations
1311
* by parsing, validating, and executing a GraphQL document along side a
@@ -57,9 +55,7 @@ export interface GraphQLArgs {
5755
fieldResolver?: Maybe<GraphQLFieldResolver<any, any>>;
5856
typeResolver?: Maybe<GraphQLTypeResolver<any, any>>;
5957
}
60-
6158
export function graphql(args: GraphQLArgs): Promise<ExecutionResult>;
62-
6359
/**
6460
* The graphqlSync function also fulfills GraphQL operations by parsing,
6561
* validating, and executing a GraphQL document along side a GraphQL schema.

0 commit comments

Comments
 (0)