Skip to content

Commit

Permalink
Make deprecation.reason non-nullable
Browse files Browse the repository at this point in the history
  • Loading branch information
martinbonnin committed Nov 22, 2024
1 parent 45e28a5 commit 935261b
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 5 deletions.
10 changes: 7 additions & 3 deletions src/type/__tests__/introspection-test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -973,9 +973,13 @@ describe('Introspection', () => {
defaultValue: '"No longer supported"',
name: 'reason',
type: {
kind: 'SCALAR',
name: 'String',
ofType: null,
kind: 'NON_NULL',
name: null,
ofType: {
kind: 'SCALAR',
name: 'String',
ofType: null,
},
},
},
],
Expand Down
2 changes: 1 addition & 1 deletion src/type/directives.ts
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ export const GraphQLDeprecatedDirective: GraphQLDirective =
],
args: {
reason: {
type: GraphQLString,
type: new GraphQLNonNull(GraphQLString),
description:
'Explains why this element was deprecated, usually also including a suggestion for how to access supported similar data. Formatted using the Markdown syntax, as specified by [CommonMark](https://commonmark.org/).',
defaultValue: DEFAULT_DEPRECATION_REASON,
Expand Down
2 changes: 1 addition & 1 deletion src/utilities/__tests__/printSchema-test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -680,7 +680,7 @@ describe('Type System Printer', () => {
"""
Explains why this element was deprecated, usually also including a suggestion for how to access supported similar data. Formatted using the Markdown syntax, as specified by [CommonMark](https://commonmark.org/).
"""
reason: String = "No longer supported"
reason: String! = "No longer supported"
) on FIELD_DEFINITION | ARGUMENT_DEFINITION | INPUT_FIELD_DEFINITION | ENUM_VALUE
"""Exposes a URL that specifies the behavior of this scalar."""
Expand Down

0 comments on commit 935261b

Please sign in to comment.