Skip to content

Commit 935261b

Browse files
committed
Make deprecation.reason non-nullable
See graphql/graphql-spec#1040
1 parent 45e28a5 commit 935261b

File tree

3 files changed

+9
-5
lines changed

3 files changed

+9
-5
lines changed

src/type/__tests__/introspection-test.ts

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -973,9 +973,13 @@ describe('Introspection', () => {
973973
defaultValue: '"No longer supported"',
974974
name: 'reason',
975975
type: {
976-
kind: 'SCALAR',
977-
name: 'String',
978-
ofType: null,
976+
kind: 'NON_NULL',
977+
name: null,
978+
ofType: {
979+
kind: 'SCALAR',
980+
name: 'String',
981+
ofType: null,
982+
},
979983
},
980984
},
981985
],

src/type/directives.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ export const GraphQLDeprecatedDirective: GraphQLDirective =
185185
],
186186
args: {
187187
reason: {
188-
type: GraphQLString,
188+
type: new GraphQLNonNull(GraphQLString),
189189
description:
190190
'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/).',
191191
defaultValue: DEFAULT_DEPRECATION_REASON,

src/utilities/__tests__/printSchema-test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -680,7 +680,7 @@ describe('Type System Printer', () => {
680680
"""
681681
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/).
682682
"""
683-
reason: String = "No longer supported"
683+
reason: String! = "No longer supported"
684684
) on FIELD_DEFINITION | ARGUMENT_DEFINITION | INPUT_FIELD_DEFINITION | ENUM_VALUE
685685
686686
"""Exposes a URL that specifies the behavior of this scalar."""

0 commit comments

Comments
 (0)