Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extend support for @deprecated directive #2081

Open
wimski opened this issue Mar 9, 2022 · 1 comment
Open

Extend support for @deprecated directive #2081

wimski opened this issue Mar 9, 2022 · 1 comment
Labels
enhancement A feature or improvement

Comments

@wimski
Copy link
Contributor

wimski commented Mar 9, 2022

The @deprecated directive currently is only allowed on FIELD_DEFINITION and ENUM_VALUE:

"""
Marks an element of a GraphQL schema as no longer supported.
"""
directive @deprecated(
  """
  Explains why this element was deprecated, usually also including a
  suggestion for how to access supported similar data. Formatted
  in [Markdown](https://daringfireball.net/projects/markdown/).
  """
  reason: String = "No longer supported"
) on FIELD_DEFINITION | ENUM_VALUE

However any schema element could become deprecated at some point, like an obsolete/unused input field for example. Would it be possible to add the following to the supported types of the @deprecated directive?

  • ARGUMENT_DEFINITION
  • INPUT_FIELD_DEFINITION
@spawnia
Copy link
Collaborator

spawnia commented Mar 9, 2022

Looks like this will be possible in an upcoming version of the GraphQL specification - see graphql/graphql-spec#805 (comment)

We have to implement this in the base library first though, see webonyx/graphql-php#110

@spawnia spawnia added the enhancement A feature or improvement label Mar 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement A feature or improvement
Projects
None yet
Development

No branches or pull requests

2 participants