Skip to content
This repository was archived by the owner on Mar 20, 2023. It is now read-only.
Merged
Changes from all commits
Commits
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 12 additions & 16 deletions src/__tests__/http-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,19 +13,18 @@ import multer from 'multer';
import { expect } from 'chai';
import { describe, it } from 'mocha';
import {
buildSchema,
GraphQLSchema,
GraphQLObjectType,
GraphQLNonNull,
GraphQLString,
GraphQLError,
ValidationContext,
BREAK,
type ASTVisitor,
type ValidationContext,
Source,
validate,
execute,
GraphQLError,
GraphQLString,
GraphQLNonNull,
GraphQLObjectType,
GraphQLSchema,
parse,
type ASTVisitor,
execute,
validate,
buildSchema,
} from 'graphql';

import { graphqlHTTP } from '../index';
Expand Down Expand Up @@ -1939,9 +1938,7 @@ function runTests(server) {
customValidateFn(schema, documentAST, validationRules) {
const errors = validate(schema, documentAST, validationRules);

const error = new GraphQLError(`custom error ${errors.length}`);

return [error];
return [new GraphQLError(`custom error ${errors.length}`)];
},
}),
);
Expand All @@ -1968,11 +1965,10 @@ function runTests(server) {
context: ValidationContext,
): ASTVisitor {
return {
enter() {
Document() {
context.reportError(
new GraphQLError('AlwaysInvalidRule was really invalid!'),
);
return BREAK;
},
};
};
Expand Down