@@ -9,19 +9,14 @@ import { toObjMapWithSymbols } from '../jsutils/toObjMap.js';
99
1010import type { DirectiveDefinitionNode } from '../language/ast.js' ;
1111import { DirectiveLocation } from '../language/directiveLocation.js' ;
12- import { Kind } from '../language/kinds.js' ;
1312
1413import { assertName } from './assertName.js' ;
1514import type {
1615 GraphQLArgumentConfig ,
1716 GraphQLFieldNormalizedConfigArgumentMap ,
1817 GraphQLSchemaElement ,
1918} from './definition.js' ;
20- import {
21- GraphQLArgument ,
22- GraphQLEnumType ,
23- GraphQLNonNull ,
24- } from './definition.js' ;
19+ import { GraphQLArgument , GraphQLNonNull } from './definition.js' ;
2520import { GraphQLBoolean , GraphQLInt , GraphQLString } from './scalars.js' ;
2621
2722/**
@@ -282,51 +277,16 @@ export const GraphQLOneOfDirective: GraphQLDirective = new GraphQLDirective({
282277} ) ;
283278
284279/**
285- * Possible error handling actions .
280+ * Disables error propagation (experimental) .
286281 */
287- export const ErrorAction = {
288- PROPAGATE : 'PROPAGATE' as const ,
289- NULL : 'NULL' as const ,
290- } as const ;
291-
292- // eslint-disable-next-line @typescript-eslint/no-redeclare
293- export type ErrorAction = ( typeof ErrorAction ) [ keyof typeof ErrorAction ] ;
294-
295- export const _ErrorAction = new GraphQLEnumType ( {
296- name : '_ErrorAction' ,
297- description : 'Possible error handling actions.' ,
298- values : {
299- PROPAGATE : {
300- value : ErrorAction . PROPAGATE ,
301- description :
302- 'Non-nullable positions that error cause the error to propagate to the nearest nullable ancestor position. The error is added to the "errors" list.' ,
303- } ,
304- NULL : {
305- value : ErrorAction . NULL ,
306- description :
307- 'Positions that error are replaced with a `null` and an error is added to the "errors" list.' ,
308- } ,
309- } ,
310- } ) ;
311-
312- /**
313- * Controls how the executor handles errors.
314- */
315- export const GraphQLOnErrorDirective = new GraphQLDirective ( {
316- name : 'onError' ,
317- description : 'Controls how the executor handles errors.' ,
282+ export const GraphQLDisableErrorPropagationDirective = new GraphQLDirective ( {
283+ name : 'experimental_disableErrorPropagation' ,
284+ description : 'Disables error propagation.' ,
318285 locations : [
319286 DirectiveLocation . QUERY ,
320287 DirectiveLocation . MUTATION ,
321288 DirectiveLocation . SUBSCRIPTION ,
322289 ] ,
323- args : {
324- action : {
325- type : new GraphQLNonNull ( _ErrorAction ) ,
326- description : 'The action to execute when a field error is encountered.' ,
327- default : { literal : { kind : Kind . ENUM , value : 'PROPAGATE' } } ,
328- } ,
329- } ,
330290} ) ;
331291
332292/**
0 commit comments