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