File tree Expand file tree Collapse file tree 1 file changed +30
-0
lines changed Expand file tree Collapse file tree 1 file changed +30
-0
lines changed Original file line number Diff line number Diff line change @@ -933,6 +933,36 @@ describe('Execute: Handles basic execution tasks', () => {
933933 } ) ;
934934 } ) ;
935935
936+ it ( 'raises request error with invalid onError' , ( ) => {
937+ const schema = new GraphQLSchema ( {
938+ query : new GraphQLObjectType ( {
939+ name : 'query' ,
940+ fields : ( ) => ( {
941+ a : {
942+ type : GraphQLInt ,
943+ resolve : ( ) => ( { } ) ,
944+ } ,
945+ } ) ,
946+ } ) ,
947+ } ) ;
948+
949+ const document = parse ( '{ a }' ) ;
950+ const result = executeSync ( {
951+ schema,
952+ document,
953+ // @ts -expect-error
954+ onError : 'DANCE' ,
955+ } ) ;
956+ expectJSON ( result ) . toDeepEqual ( {
957+ errors : [
958+ {
959+ message :
960+ 'Unsupported `onError` value; supported values are `PROPAGATE`, `NO_PROPAGATE` and `ABORT`.' ,
961+ } ,
962+ ] ,
963+ } ) ;
964+ } ) ;
965+
936966 it ( 'uses the inline operation if no operation name is provided' , ( ) => {
937967 const schema = new GraphQLSchema ( {
938968 query : new GraphQLObjectType ( {
You can’t perform that action at this time.
0 commit comments