@@ -95,14 +95,14 @@ export function directiveDescriptionChangedFromMeta(args: DirectiveDescriptionCh
95
95
}
96
96
97
97
export function directiveDescriptionChanged (
98
- oldDirective : GraphQLDirective ,
98
+ oldDirective : GraphQLDirective | null ,
99
99
newDirective : GraphQLDirective ,
100
100
) : Change < typeof ChangeType . DirectiveDescriptionChanged > {
101
101
return directiveDescriptionChangedFromMeta ( {
102
102
type : ChangeType . DirectiveDescriptionChanged ,
103
103
meta : {
104
- directiveName : oldDirective . name ,
105
- oldDirectiveDescription : oldDirective . description ?? null ,
104
+ directiveName : newDirective . name ,
105
+ oldDirectiveDescription : oldDirective ? .description ?? null ,
106
106
newDirectiveDescription : newDirective . description ?? null ,
107
107
} ,
108
108
} ) ;
@@ -262,15 +262,15 @@ export function directiveArgumentDescriptionChangedFromMeta(
262
262
263
263
export function directiveArgumentDescriptionChanged (
264
264
directive : GraphQLDirective ,
265
- oldArg : GraphQLArgument ,
265
+ oldArg : GraphQLArgument | null ,
266
266
newArg : GraphQLArgument ,
267
267
) : Change < typeof ChangeType . DirectiveArgumentDescriptionChanged > {
268
268
return directiveArgumentDescriptionChangedFromMeta ( {
269
269
type : ChangeType . DirectiveArgumentDescriptionChanged ,
270
270
meta : {
271
271
directiveName : directive . name ,
272
- directiveArgumentName : oldArg . name ,
273
- oldDirectiveArgumentDescription : oldArg . description ?? null ,
272
+ directiveArgumentName : newArg . name ,
273
+ oldDirectiveArgumentDescription : oldArg ? .description ?? null ,
274
274
newDirectiveArgumentDescription : newArg . description ?? null ,
275
275
} ,
276
276
} ) ;
@@ -304,14 +304,14 @@ export function directiveArgumentDefaultValueChangedFromMeta(
304
304
305
305
export function directiveArgumentDefaultValueChanged (
306
306
directive : GraphQLDirective ,
307
- oldArg : GraphQLArgument ,
307
+ oldArg : GraphQLArgument | null ,
308
308
newArg : GraphQLArgument ,
309
309
) : Change < typeof ChangeType . DirectiveArgumentDefaultValueChanged > {
310
310
const meta : DirectiveArgumentDefaultValueChangedChange [ 'meta' ] = {
311
311
directiveName : directive . name ,
312
- directiveArgumentName : oldArg . name ,
312
+ directiveArgumentName : newArg . name ,
313
313
} ;
314
- if ( oldArg . defaultValue !== undefined ) {
314
+ if ( oldArg ? .defaultValue !== undefined ) {
315
315
meta . oldDirectiveArgumentDefaultValue = safeString ( oldArg . defaultValue ) ;
316
316
}
317
317
if ( newArg . defaultValue !== undefined ) {
@@ -352,17 +352,17 @@ export function directiveArgumentTypeChangedFromMeta(args: DirectiveArgumentType
352
352
353
353
export function directiveArgumentTypeChanged (
354
354
directive : GraphQLDirective ,
355
- oldArg : GraphQLArgument ,
355
+ oldArg : GraphQLArgument | null ,
356
356
newArg : GraphQLArgument ,
357
357
) : Change < typeof ChangeType . DirectiveArgumentTypeChanged > {
358
358
return directiveArgumentTypeChangedFromMeta ( {
359
359
type : ChangeType . DirectiveArgumentTypeChanged ,
360
360
meta : {
361
361
directiveName : directive . name ,
362
- directiveArgumentName : oldArg . name ,
363
- oldDirectiveArgumentType : oldArg . type . toString ( ) ,
362
+ directiveArgumentName : newArg . name ,
363
+ oldDirectiveArgumentType : oldArg ? .type . toString ( ) ?? '' ,
364
364
newDirectiveArgumentType : newArg . type . toString ( ) ,
365
- isSafeDirectiveArgumentTypeChange : safeChangeForInputValue ( oldArg . type , newArg . type ) ,
365
+ isSafeDirectiveArgumentTypeChange : safeChangeForInputValue ( oldArg ? .type ?? null , newArg . type ) ,
366
366
} ,
367
367
} ) ;
368
368
}
0 commit comments