Skip to content

Commit e5bcf5b

Browse files
authored
Make deprecated.reason non-nullable (#4299)
See graphql/graphql-spec#1040
1 parent 3ad80e4 commit e5bcf5b

File tree

3 files changed

+9
-5
lines changed

3 files changed

+9
-5
lines changed

Diff for: src/type/__tests__/introspection-test.ts

+7-3
Original file line numberDiff line numberDiff line change
@@ -978,9 +978,13 @@ describe('Introspection', () => {
978978
defaultValue: '"No longer supported"',
979979
name: 'reason',
980980
type: {
981-
kind: 'SCALAR',
982-
name: 'String',
983-
ofType: null,
981+
kind: 'NON_NULL',
982+
name: null,
983+
ofType: {
984+
kind: 'SCALAR',
985+
name: 'String',
986+
ofType: null,
987+
},
984988
},
985989
},
986990
],

Diff for: src/type/directives.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -241,7 +241,7 @@ export const GraphQLDeprecatedDirective: GraphQLDirective =
241241
],
242242
args: {
243243
reason: {
244-
type: GraphQLString,
244+
type: new GraphQLNonNull(GraphQLString),
245245
description:
246246
'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/).',
247247
defaultValue: DEFAULT_DEPRECATION_REASON,

Diff for: src/utilities/__tests__/printSchema-test.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -803,7 +803,7 @@ describe('Type System Printer', () => {
803803
"""
804804
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/).
805805
"""
806-
reason: String = "No longer supported"
806+
reason: String! = "No longer supported"
807807
) on FIELD_DEFINITION | ARGUMENT_DEFINITION | INPUT_FIELD_DEFINITION | ENUM_VALUE
808808
809809
"""Exposes a URL that specifies the behavior of this scalar."""

0 commit comments

Comments
 (0)