Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,7 @@ internal val builtinsDefinitionsStr = """
directive @include(if: Boolean!) on FIELD | FRAGMENT_SPREAD | INLINE_FRAGMENT

directive @deprecated(
reason: String = "No longer supported"
reason: String! = "No longer supported"
) on FIELD_DEFINITION | ARGUMENT_DEFINITION | INPUT_FIELD_DEFINITION | ENUM_VALUE

directive @defer(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -369,16 +369,11 @@ private class GQLDocumentBuilder(private val introspectionSchema: IntrospectionS
}

/**
* This assumes the case where `deprecationReason == null && isDeprecated` is not valid
* which is unclear from reading the spec as the below seems allowed:
* This assumes the case where `deprecationReason == null && isDeprecated` is not valid.
*
* ```
* type Query {
* foo: Int @deprecated(reason: null)
* }
* ```
* See https://github.com/graphql/graphql-spec/pull/1040
*
* If there are legit use cases for `@deprecated(reason: null)` we should update this function
* If a legacy schema contains `@deprecated(reason: null)`, the field appears as non-deprecated.
*/
fun makeDirectives(deprecationReason: String?): List<GQLDirective> {
if (deprecationReason == null) {
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion tests/sample-server/graphql/schema.graphqls
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ directive @skip (if: Boolean!) on FIELD|FRAGMENT_SPREAD|INLINE_FRAGMENT

directive @include (if: Boolean!) on FIELD|FRAGMENT_SPREAD|INLINE_FRAGMENT

directive @deprecated (reason: String = "No longer supported") on FIELD_DEFINITION|ARGUMENT_DEFINITION|INPUT_FIELD_DEFINITION|ENUM_VALUE
directive @deprecated (reason: String! = "No longer supported") on FIELD_DEFINITION|ARGUMENT_DEFINITION|INPUT_FIELD_DEFINITION|ENUM_VALUE

directive @defer (label: String, if: Boolean! = true) on FRAGMENT_SPREAD|INLINE_FRAGMENT

Expand Down
Loading