Skip to content

Commit

Permalink
Make deprecated.reason non-nullable (#4299)
Browse files Browse the repository at this point in the history
  • Loading branch information
martinbonnin authored Dec 5, 2024
1 parent 3ad80e4 commit e5bcf5b
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 @@ -978,9 +978,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 @@ -241,7 +241,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 @@ -803,7 +803,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 e5bcf5b

Please sign in to comment.