From 0d0f98684f22eadcd8ecd439705abae21c212e71 Mon Sep 17 00:00:00 2001 From: Lee Byron Date: Wed, 26 May 2021 22:23:48 -0700 Subject: [PATCH] TS: Fix strict issues in src/error --- src/__tests__/starWarsSchema.ts | 2 +- src/error/GraphQLError.ts | 9 --------- src/error/__tests__/formatError-test.ts | 2 ++ 3 files changed, 3 insertions(+), 10 deletions(-) diff --git a/src/__tests__/starWarsSchema.ts b/src/__tests__/starWarsSchema.ts index 16a80fcee76..e915c98f39e 100644 --- a/src/__tests__/starWarsSchema.ts +++ b/src/__tests__/starWarsSchema.ts @@ -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: () => ({ diff --git a/src/error/GraphQLError.ts b/src/error/GraphQLError.ts index 68ddeda7029..89a82eef298 100644 --- a/src/error/GraphQLError.ts +++ b/src/error/GraphQLError.ts @@ -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. diff --git a/src/error/__tests__/formatError-test.ts b/src/error/__tests__/formatError-test.ts index d618f8d2d03..9ea5e946ef4 100644 --- a/src/error/__tests__/formatError-test.ts +++ b/src/error/__tests__/formatError-test.ts @@ -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.', );