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

remove the enhanced error messages regarding using multiple versions of graphql-js. #4238

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
79 changes: 0 additions & 79 deletions src/jsutils/__tests__/instanceOf-test.ts

This file was deleted.

59 changes: 0 additions & 59 deletions src/jsutils/instanceOf.ts

This file was deleted.

3 changes: 1 addition & 2 deletions src/language/source.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { devAssert } from '../jsutils/devAssert.js';
import { instanceOf } from '../jsutils/instanceOf.js';

interface Location {
line: number;
Expand Down Expand Up @@ -47,5 +46,5 @@ export class Source {
* @internal
*/
export function isSource(source: unknown): source is Source {
return instanceOf(source, Source);
return source instanceof Source;
}
17 changes: 8 additions & 9 deletions src/type/definition.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import { devAssert } from '../jsutils/devAssert.js';
import { didYouMean } from '../jsutils/didYouMean.js';
import { identityFunc } from '../jsutils/identityFunc.js';
import { inspect } from '../jsutils/inspect.js';
import { instanceOf } from '../jsutils/instanceOf.js';
import { keyMap } from '../jsutils/keyMap.js';
import { keyValMap } from '../jsutils/keyValMap.js';
import { mapValue } from '../jsutils/mapValue.js';
Expand Down Expand Up @@ -78,7 +77,7 @@ export function assertType(type: unknown): GraphQLType {
* There are predicates for each kind of GraphQL type.
*/
export function isScalarType(type: unknown): type is GraphQLScalarType {
return instanceOf(type, GraphQLScalarType);
return type instanceof GraphQLScalarType;
}

export function assertScalarType(type: unknown): GraphQLScalarType {
Expand All @@ -89,7 +88,7 @@ export function assertScalarType(type: unknown): GraphQLScalarType {
}

export function isObjectType(type: unknown): type is GraphQLObjectType {
return instanceOf(type, GraphQLObjectType);
return type instanceof GraphQLObjectType;
}

export function assertObjectType(type: unknown): GraphQLObjectType {
Expand All @@ -100,7 +99,7 @@ export function assertObjectType(type: unknown): GraphQLObjectType {
}

export function isInterfaceType(type: unknown): type is GraphQLInterfaceType {
return instanceOf(type, GraphQLInterfaceType);
return type instanceof GraphQLInterfaceType;
}

export function assertInterfaceType(type: unknown): GraphQLInterfaceType {
Expand All @@ -113,7 +112,7 @@ export function assertInterfaceType(type: unknown): GraphQLInterfaceType {
}

export function isUnionType(type: unknown): type is GraphQLUnionType {
return instanceOf(type, GraphQLUnionType);
return type instanceof GraphQLUnionType;
}

export function assertUnionType(type: unknown): GraphQLUnionType {
Expand All @@ -124,7 +123,7 @@ export function assertUnionType(type: unknown): GraphQLUnionType {
}

export function isEnumType(type: unknown): type is GraphQLEnumType {
return instanceOf(type, GraphQLEnumType);
return type instanceof GraphQLEnumType;
}

export function assertEnumType(type: unknown): GraphQLEnumType {
Expand All @@ -137,7 +136,7 @@ export function assertEnumType(type: unknown): GraphQLEnumType {
export function isInputObjectType(
type: unknown,
): type is GraphQLInputObjectType {
return instanceOf(type, GraphQLInputObjectType);
return type instanceof GraphQLInputObjectType;
}

export function assertInputObjectType(type: unknown): GraphQLInputObjectType {
Expand All @@ -157,7 +156,7 @@ export function isListType(
): type is GraphQLList<GraphQLOutputType>;
export function isListType(type: unknown): type is GraphQLList<GraphQLType>;
export function isListType(type: unknown): type is GraphQLList<GraphQLType> {
return instanceOf(type, GraphQLList);
return type instanceof GraphQLList;
}

export function assertListType(type: unknown): GraphQLList<GraphQLType> {
Expand All @@ -179,7 +178,7 @@ export function isNonNullType(
export function isNonNullType(
type: unknown,
): type is GraphQLNonNull<GraphQLNullableType> {
return instanceOf(type, GraphQLNonNull);
return type instanceof GraphQLNonNull;
}

export function assertNonNullType(
Expand Down
3 changes: 1 addition & 2 deletions src/type/directives.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { inspect } from '../jsutils/inspect.js';
import { instanceOf } from '../jsutils/instanceOf.js';
import type { Maybe } from '../jsutils/Maybe.js';
import { toObjMap } from '../jsutils/toObjMap.js';

Expand All @@ -22,7 +21,7 @@ import { GraphQLBoolean, GraphQLInt, GraphQLString } from './scalars.js';
* Test if the given value is a GraphQL directive.
*/
export function isDirective(directive: unknown): directive is GraphQLDirective {
return instanceOf(directive, GraphQLDirective);
return directive instanceof GraphQLDirective;
}

export function assertDirective(directive: unknown): GraphQLDirective {
Expand Down
3 changes: 1 addition & 2 deletions src/type/schema.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { inspect } from '../jsutils/inspect.js';
import { instanceOf } from '../jsutils/instanceOf.js';
import type { Maybe } from '../jsutils/Maybe.js';
import type { ObjMap } from '../jsutils/ObjMap.js';
import { toObjMap } from '../jsutils/toObjMap.js';
Expand Down Expand Up @@ -41,7 +40,7 @@ import {
* Test if the given value is a GraphQL schema.
*/
export function isSchema(schema: unknown): schema is GraphQLSchema {
return instanceOf(schema, GraphQLSchema);
return schema instanceof GraphQLSchema;
}

export function assertSchema(schema: unknown): GraphQLSchema {
Expand Down
Loading