@@ -95,14 +95,14 @@ export function directiveDescriptionChangedFromMeta(args: DirectiveDescriptionCh
9595}
9696
9797export function directiveDescriptionChanged (
98- oldDirective : GraphQLDirective ,
98+ oldDirective : GraphQLDirective | null ,
9999 newDirective : GraphQLDirective ,
100100) : Change < typeof ChangeType . DirectiveDescriptionChanged > {
101101 return directiveDescriptionChangedFromMeta ( {
102102 type : ChangeType . DirectiveDescriptionChanged ,
103103 meta : {
104- directiveName : oldDirective . name ,
105- oldDirectiveDescription : oldDirective . description ?? null ,
104+ directiveName : newDirective . name ,
105+ oldDirectiveDescription : oldDirective ? .description ?? null ,
106106 newDirectiveDescription : newDirective . description ?? null ,
107107 } ,
108108 } ) ;
@@ -262,15 +262,15 @@ export function directiveArgumentDescriptionChangedFromMeta(
262262
263263export function directiveArgumentDescriptionChanged (
264264 directive : GraphQLDirective ,
265- oldArg : GraphQLArgument ,
265+ oldArg : GraphQLArgument | null ,
266266 newArg : GraphQLArgument ,
267267) : Change < typeof ChangeType . DirectiveArgumentDescriptionChanged > {
268268 return directiveArgumentDescriptionChangedFromMeta ( {
269269 type : ChangeType . DirectiveArgumentDescriptionChanged ,
270270 meta : {
271271 directiveName : directive . name ,
272- directiveArgumentName : oldArg . name ,
273- oldDirectiveArgumentDescription : oldArg . description ?? null ,
272+ directiveArgumentName : newArg . name ,
273+ oldDirectiveArgumentDescription : oldArg ? .description ?? null ,
274274 newDirectiveArgumentDescription : newArg . description ?? null ,
275275 } ,
276276 } ) ;
@@ -304,14 +304,14 @@ export function directiveArgumentDefaultValueChangedFromMeta(
304304
305305export function directiveArgumentDefaultValueChanged (
306306 directive : GraphQLDirective ,
307- oldArg : GraphQLArgument ,
307+ oldArg : GraphQLArgument | null ,
308308 newArg : GraphQLArgument ,
309309) : Change < typeof ChangeType . DirectiveArgumentDefaultValueChanged > {
310310 const meta : DirectiveArgumentDefaultValueChangedChange [ 'meta' ] = {
311311 directiveName : directive . name ,
312- directiveArgumentName : oldArg . name ,
312+ directiveArgumentName : newArg . name ,
313313 } ;
314- if ( oldArg . defaultValue !== undefined ) {
314+ if ( oldArg ? .defaultValue !== undefined ) {
315315 meta . oldDirectiveArgumentDefaultValue = safeString ( oldArg . defaultValue ) ;
316316 }
317317 if ( newArg . defaultValue !== undefined ) {
@@ -352,17 +352,17 @@ export function directiveArgumentTypeChangedFromMeta(args: DirectiveArgumentType
352352
353353export function directiveArgumentTypeChanged (
354354 directive : GraphQLDirective ,
355- oldArg : GraphQLArgument ,
355+ oldArg : GraphQLArgument | null ,
356356 newArg : GraphQLArgument ,
357357) : Change < typeof ChangeType . DirectiveArgumentTypeChanged > {
358358 return directiveArgumentTypeChangedFromMeta ( {
359359 type : ChangeType . DirectiveArgumentTypeChanged ,
360360 meta : {
361361 directiveName : directive . name ,
362- directiveArgumentName : oldArg . name ,
363- oldDirectiveArgumentType : oldArg . type . toString ( ) ,
362+ directiveArgumentName : newArg . name ,
363+ oldDirectiveArgumentType : oldArg ? .type . toString ( ) ?? '' ,
364364 newDirectiveArgumentType : newArg . type . toString ( ) ,
365- isSafeDirectiveArgumentTypeChange : safeChangeForInputValue ( oldArg . type , newArg . type ) ,
365+ isSafeDirectiveArgumentTypeChange : safeChangeForInputValue ( oldArg ? .type ?? null , newArg . type ) ,
366366 } ,
367367 } ) ;
368368}
0 commit comments