Skip to content

Commit

Permalink
Remove empty lines from '*.d.ts' files
Browse files Browse the repository at this point in the history
We will remove those files anyway after TS migration
but it makes easier to diff generated and handwritten files
  • Loading branch information
IvanGoncharov committed May 20, 2021
1 parent d4ca247 commit 1c513ca
Show file tree
Hide file tree
Showing 99 changed files with 4 additions and 663 deletions.
4 changes: 4 additions & 0 deletions .eslintrc.yml
Expand Up @@ -665,6 +665,10 @@ overrides:
'@typescript-eslint/space-before-function-paren': off
'@typescript-eslint/space-infix-ops': off
'@typescript-eslint/type-annotation-spacing': off
- files: 'src/**/*.d.ts'
rules:
import/order: off
import/newline-after-import: off
- files: 'src/**/__*__/**'
rules:
node/no-unpublished-import: [error, { allowModules: ['chai', 'mocha'] }]
Expand Down
11 changes: 0 additions & 11 deletions src/error/GraphQLError.d.ts
@@ -1,9 +1,7 @@
import type { Maybe } from '../jsutils/Maybe';

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
* execute phases of performing a GraphQL operation. In addition to a message
Expand All @@ -20,7 +18,6 @@ export class GraphQLError extends Error {
originalError?: Maybe<Error>,
extensions?: Maybe<{ [key: string]: unknown }>,
);

/**
* A message describing the Error for debugging purposes.
*
Expand All @@ -29,7 +26,6 @@ export class GraphQLError extends Error {
* Note: should be treated as readonly, despite invariant usage.
*/
message: string;

/**
* An array of { line, column } locations within the source GraphQL document
* which correspond to this error.
Expand All @@ -41,45 +37,38 @@ export class GraphQLError extends Error {
* Enumerable, and appears in the result of JSON.stringify().
*/
readonly locations: ReadonlyArray<SourceLocation> | undefined;

/**
* An array describing the JSON-path into the execution response which
* corresponds to this error. Only included for errors during execution.
*
* Enumerable, and appears in the result of JSON.stringify().
*/
readonly path: ReadonlyArray<string | number> | undefined;

/**
* An array of GraphQL AST Nodes corresponding to this error.
*/
readonly nodes: ReadonlyArray<ASTNode> | undefined;

/**
* The source GraphQL document corresponding to this error.
*
* Note that if this Error represents more than one node, the source may not
* represent nodes after the first node.
*/
readonly source: Source | undefined;

/**
* An array of character offsets within the source GraphQL document
* which correspond to this error.
*/
readonly positions: ReadonlyArray<number> | undefined;

/**
* The original error thrown from a field resolver during execution.
*/
readonly originalError: Maybe<Error>;

/**
* Extension fields to add to the formatted error.
*/
readonly extensions: { [key: string]: unknown } | undefined;
}

/**
* Prints a GraphQLError to a string, representing useful location information
* about the error's position in the source.
Expand Down
3 changes: 0 additions & 3 deletions src/error/formatError.d.ts
@@ -1,13 +1,10 @@
import type { SourceLocation } from '../language/location';

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

/**
* Given a GraphQLError, format it according to the rules described by the
* Response Format, Errors section of the GraphQL Specification.
*/
export function formatError(error: GraphQLError): GraphQLFormattedError;

/**
* @see https://github.com/graphql/graphql-spec/blob/master/spec/Section%207%20--%20Response.md#errors
*/
Expand Down
3 changes: 0 additions & 3 deletions src/error/locatedError.d.ts
@@ -1,9 +1,6 @@
import type { Maybe } from '../jsutils/Maybe';

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

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

/**
* Given an arbitrary value, presumably thrown while attempting to execute a
* GraphQL operation, produce a new GraphQLError aware of the location in the
Expand Down
2 changes: 0 additions & 2 deletions src/error/syntaxError.d.ts
@@ -1,7 +1,5 @@
import type { Source } from '../language/source';

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

/**
* Produces a GraphQLError representing a syntax error, containing useful
* descriptive information about the syntax error's position in the source.
Expand Down
17 changes: 0 additions & 17 deletions src/execution/execute.d.ts
@@ -1,12 +1,9 @@
import type { Maybe } from '../jsutils/Maybe';
import type { ObjMap } from '../jsutils/ObjMap';

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

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

import type {
DocumentNode,
OperationDefinitionNode,
Expand All @@ -22,7 +19,6 @@ import type {
GraphQLTypeResolver,
GraphQLObjectType,
} from '../type/definition';

/**
* Terminology
*
Expand All @@ -42,7 +38,6 @@ import type {
* 2) fragment "spreads" e.g. "...c"
* 3) inline fragment "spreads" e.g. "...on Type { a }"
*/

/**
* Data that must be available at all points during query execution.
*
Expand All @@ -60,7 +55,6 @@ export interface ExecutionContext {
typeResolver: GraphQLTypeResolver<any, any>;
errors: Array<GraphQLError>;
}

/**
* The result of GraphQL execution.
*
Expand All @@ -77,7 +71,6 @@ export interface ExecutionResult<
data?: TData | null;
extensions?: TExtensions;
}

export interface FormattedExecutionResult<
TData = { [key: string]: any },
TExtensions = { [key: string]: any },
Expand All @@ -87,7 +80,6 @@ export interface FormattedExecutionResult<
data?: TData | null;
extensions?: TExtensions;
}

export interface ExecutionArgs {
schema: GraphQLSchema;
document: DocumentNode;
Expand All @@ -98,7 +90,6 @@ export interface ExecutionArgs {
fieldResolver?: Maybe<GraphQLFieldResolver<any, any>>;
typeResolver?: Maybe<GraphQLTypeResolver<any, any>>;
}

/**
* Implements the "Evaluating requests" section of the GraphQL specification.
*
Expand All @@ -110,14 +101,12 @@ export interface ExecutionArgs {
* a GraphQLError will be thrown immediately explaining the invalid input.
*/
export function execute(args: ExecutionArgs): PromiseOrValue<ExecutionResult>;

/**
* Also implements the "Evaluating requests" section of the GraphQL specification.
* However, it guarantees to complete synchronously (or throw an error) assuming
* that all field resolvers are also synchronous.
*/
export function executeSync(args: ExecutionArgs): ExecutionResult;

/**
* Essential assertions before executing to provide developer feedback for
* improper use of the GraphQL library.
Expand All @@ -129,7 +118,6 @@ export function assertValidExecutionArguments(
document: DocumentNode,
rawVariableValues: Maybe<{ [key: string]: unknown }>,
): void;

/**
* Constructs a ExecutionContext object from the arguments passed to
* execute, which we will pass throughout the other execution methods.
Expand All @@ -148,7 +136,6 @@ export function buildExecutionContext(
fieldResolver: Maybe<GraphQLFieldResolver<unknown, unknown>>,
typeResolver?: Maybe<GraphQLTypeResolver<unknown, unknown>>,
): ReadonlyArray<GraphQLError> | ExecutionContext;

/**
* Given a selectionSet, adds all of the fields in that selection to
* the passed in map of fields, and returns it at the end.
Expand All @@ -166,7 +153,6 @@ export function collectFields(
fields: ObjMap<Array<FieldNode>>,
visitedFragmentNames: ObjMap<boolean>,
): ObjMap<Array<FieldNode>>;

/**
* @internal
*/
Expand All @@ -177,7 +163,6 @@ export function buildResolveInfo(
parentType: GraphQLObjectType,
path: Path,
): GraphQLResolveInfo;

/**
* If a resolveType function is not given, then a default resolve behavior is
* used which attempts two strategies:
Expand All @@ -189,15 +174,13 @@ export function buildResolveInfo(
* isTypeOf for the object being coerced, returning the first type that matches.
*/
export const defaultTypeResolver: GraphQLTypeResolver<unknown, unknown>;

/**
* If a resolve function is not given, then a default resolve behavior is used
* which takes the property of the source object of the same name as the field
* and returns it as the result, or if it's a function, returns the result
* of calling that function while passing along args and context value.
*/
export const defaultFieldResolver: GraphQLFieldResolver<unknown, unknown>;

/**
* This method looks up the field on the given type definition.
* It has special casing for the three introspection fields,
Expand Down
2 changes: 0 additions & 2 deletions src/execution/index.d.ts
@@ -1,5 +1,4 @@
export { pathToArray as responsePathAsArray } from '../jsutils/Path';

export {
execute,
executeSync,
Expand All @@ -9,5 +8,4 @@ export {
ExecutionResult,
FormattedExecutionResult,
} from './execute';

export { getDirectiveValues } from './values';
6 changes: 0 additions & 6 deletions src/execution/values.d.ts
@@ -1,21 +1,17 @@
import type { Maybe } from '../jsutils/Maybe';
import type { ObjMap } from '../jsutils/ObjMap';

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

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 }
| { errors?: never; coerced: { [key: string]: unknown } };

/**
* Prepares an object map of variableValues of the correct type based on the
* provided variable definitions and arbitrary input. If the input cannot be
Expand All @@ -31,7 +27,6 @@ export function getVariableValues(
inputs: { [key: string]: unknown },
options?: { maxErrors?: number },
): CoercedVariableValues;

/**
* Prepares an object map of argument values given a list of argument
* definitions and list of argument AST nodes.
Expand All @@ -45,7 +40,6 @@ export function getArgumentValues(
node: FieldNode | DirectiveNode,
variableValues?: Maybe<ObjMap<unknown>>,
): { [key: string]: unknown };

/**
* Prepares an object map of argument values given a directive definition
* and a AST node which may contain directives. Optionally also accepts a map
Expand Down
4 changes: 0 additions & 4 deletions src/graphql.d.ts
@@ -1,13 +1,11 @@
import type { Maybe } from './jsutils/Maybe';

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
* by parsing, validating, and executing a GraphQL document along side a
Expand Down Expand Up @@ -57,9 +55,7 @@ export interface GraphQLArgs {
fieldResolver?: Maybe<GraphQLFieldResolver<any, any>>;
typeResolver?: Maybe<GraphQLTypeResolver<any, any>>;
}

export function graphql(args: GraphQLArgs): Promise<ExecutionResult>;

/**
* The graphqlSync function also fulfills GraphQL operations by parsing,
* validating, and executing a GraphQL document along side a GraphQL schema.
Expand Down

0 comments on commit 1c513ca

Please sign in to comment.