This repository was archived by the owner on Mar 20, 2023. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +12
-16
lines changed Expand file tree Collapse file tree 1 file changed +12
-16
lines changed Original file line number Diff line number Diff line change @@ -13,19 +13,18 @@ import multer from 'multer';
13
13
import { expect } from 'chai' ;
14
14
import { describe , it } from 'mocha' ;
15
15
import {
16
- buildSchema ,
17
- GraphQLSchema ,
18
- GraphQLObjectType ,
19
- GraphQLNonNull ,
20
- GraphQLString ,
21
- GraphQLError ,
22
- ValidationContext ,
23
- BREAK ,
16
+ type ASTVisitor ,
17
+ type ValidationContext ,
24
18
Source ,
25
- validate ,
26
- execute ,
19
+ GraphQLError ,
20
+ GraphQLString ,
21
+ GraphQLNonNull ,
22
+ GraphQLObjectType ,
23
+ GraphQLSchema ,
27
24
parse ,
28
- type ASTVisitor ,
25
+ execute ,
26
+ validate ,
27
+ buildSchema ,
29
28
} from 'graphql' ;
30
29
31
30
import { graphqlHTTP } from '../index' ;
@@ -1939,9 +1938,7 @@ function runTests(server) {
1939
1938
customValidateFn ( schema , documentAST , validationRules ) {
1940
1939
const errors = validate ( schema , documentAST , validationRules ) ;
1941
1940
1942
- const error = new GraphQLError ( `custom error ${ errors . length } ` ) ;
1943
-
1944
- return [ error ] ;
1941
+ return [ new GraphQLError ( `custom error ${ errors . length } ` ) ] ;
1945
1942
} ,
1946
1943
} ) ,
1947
1944
) ;
@@ -1968,11 +1965,10 @@ function runTests(server) {
1968
1965
context : ValidationContext ,
1969
1966
) : ASTVisitor {
1970
1967
return {
1971
- enter ( ) {
1968
+ Document ( ) {
1972
1969
context . reportError (
1973
1970
new GraphQLError ( 'AlwaysInvalidRule was really invalid!' ) ,
1974
1971
) ;
1975
- return BREAK ;
1976
1972
} ,
1977
1973
} ;
1978
1974
} ;
You can’t perform that action at this time.
0 commit comments