Skip to content

Commit

Permalink
TS: Fix strict issues in src/error
Browse files Browse the repository at this point in the history
  • Loading branch information
leebyron committed May 27, 2021
1 parent 5083558 commit 0d0f986
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 10 deletions.
2 changes: 1 addition & 1 deletion src/__tests__/starWarsSchema.ts
Expand Up @@ -98,7 +98,7 @@ const episodeEnum = new GraphQLEnumType({
* secretBackstory: String
* }
*/
const characterInterface = new GraphQLInterfaceType({
const characterInterface: GraphQLInterfaceType = new GraphQLInterfaceType({
name: 'Character',
description: 'A character in the Star Wars Trilogy',
fields: () => ({
Expand Down
9 changes: 0 additions & 9 deletions src/error/GraphQLError.ts
Expand Up @@ -14,15 +14,6 @@ import { printLocation, printSourceLocation } from '../language/printLocation';
* GraphQL document and/or execution result that correspond to the Error.
*/
export class GraphQLError extends Error {
/**
* A message describing the Error for debugging purposes.
*
* Enumerable, and appears in the result of JSON.stringify().
*
* 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 Down
2 changes: 2 additions & 0 deletions src/error/__tests__/formatError-test.ts
Expand Up @@ -45,10 +45,12 @@ describe('formatError: default error formatter', () => {
});

it('rejects null and undefined errors', () => {
// TODO ts-expect-error (formatError expects a value)
expect(() => formatError(undefined)).to.throw(
'Received null or undefined error.',
);

// TODO ts-expect-error (formatError expects a value)
expect(() => formatError(null)).to.throw(
'Received null or undefined error.',
);
Expand Down

0 comments on commit 0d0f986

Please sign in to comment.