diff --git a/src/error/GraphQLError.ts b/src/error/GraphQLError.ts index c543ac4469..7fec960883 100644 --- a/src/error/GraphQLError.ts +++ b/src/error/GraphQLError.ts @@ -237,23 +237,3 @@ export interface GraphQLFormattedError { */ readonly extensions?: { [key: string]: unknown }; } - -/** - * Prints a GraphQLError to a string, representing useful location information - * about the error's position in the source. - * - * @deprecated Please use `error.toString` instead. Will be removed in v17 - */ -export function printError(error: GraphQLError): string { - return error.toString(); -} - -/** - * Given a GraphQLError, format it according to the rules described by the - * Response Format, Errors section of the GraphQL Specification. - * - * @deprecated Please use `error.toJSON` instead. Will be removed in v17 - */ -export function formatError(error: GraphQLError): GraphQLFormattedError { - return error.toJSON(); -} diff --git a/src/error/__tests__/GraphQLError-test.ts b/src/error/__tests__/GraphQLError-test.ts index 668d9404d8..05d9be84e0 100644 --- a/src/error/__tests__/GraphQLError-test.ts +++ b/src/error/__tests__/GraphQLError-test.ts @@ -9,7 +9,7 @@ import { Kind } from '../../language/kinds'; import { parse } from '../../language/parser'; import { Source } from '../../language/source'; -import { formatError, GraphQLError, printError } from '../GraphQLError'; +import { GraphQLError } from '../GraphQLError'; const source = new Source(dedent` { @@ -223,11 +223,6 @@ describe('GraphQLError', () => { }); describe('toString', () => { - it('Deprecated: prints an error using printError', () => { - const error = new GraphQLError('Error'); - expect(printError(error)).to.equal('Error'); - }); - it('prints an error without location', () => { const error = new GraphQLError('Error without location'); expect(error.toString()).to.equal('Error without location'); @@ -294,13 +289,6 @@ describe('toString', () => { }); describe('toJSON', () => { - it('Deprecated: format an error using formatError', () => { - const error = new GraphQLError('Example Error'); - expect(formatError(error)).to.deep.equal({ - message: 'Example Error', - }); - }); - it('includes path', () => { const error = new GraphQLError('msg', { path: ['path', 3, 'to', 'field'] }); diff --git a/src/error/index.ts b/src/error/index.ts index dd92e48364..0d51428ed3 100644 --- a/src/error/index.ts +++ b/src/error/index.ts @@ -1,4 +1,4 @@ -export { GraphQLError, printError, formatError } from './GraphQLError'; +export { GraphQLError } from './GraphQLError'; export type { GraphQLErrorOptions, GraphQLFormattedError, diff --git a/src/index.ts b/src/index.ts index b03b2f31cf..a6bfc9476f 100644 --- a/src/index.ts +++ b/src/index.ts @@ -377,13 +377,7 @@ export { export type { ValidationRule } from './validation/index'; // Create, format, and print GraphQL errors. -export { - GraphQLError, - syntaxError, - locatedError, - printError, - formatError, -} from './error/index'; +export { GraphQLError, syntaxError, locatedError } from './error/index'; export type { GraphQLErrorOptions,