RFC 3 / Accepted

Make the reason argument in `@deprecated` non-nullable

Opened on2023-08-23
Merged on2024-12-05

At a glance

Spec PR description

Follow up from https://github.com/graphql/graphql-spec/issues/53#issuecomment-1688335159

Make reason non-nullable:

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

This is technically a breaking change for someone that does this:

type Foo {
  bar: String! @deprecated(reason: null)
}

But feels like this shouldn't be allowed in the first place?

Fixes https://github.com/graphql/graphql-spec/issues/53

Timeline