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

Allow deprecation of input values #525

Merged
merged 1 commit into from Dec 3, 2020

Conversation

smitt04
Copy link
Contributor

@smitt04 smitt04 commented Oct 23, 2018

Started the @deprecated proposal in reference to #197

Please let me know if there is anything i missed or you would like changed. This was just a quick update to get the ball rolling again.

@IvanGoncharov Are you still interested in reviewing this?

@facebook-github-bot
Copy link

Thank you for your pull request and welcome to our community. We require contributors to sign our Contributor License Agreement, and we don't seem to have you on file. In order for us to review and merge your code, please sign up at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need the corporate CLA signed.

If you have received this in error or have any questions, please contact us at cla@fb.com. Thanks!

@facebook-github-bot
Copy link

Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Facebook open source project. Thanks!

@@ -1778,3 +1778,15 @@ type ExampleType {
oldField: String @deprecated(reason: "Use `newField`.")
}
```

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you also need to expand above text:

The @deprecated directive is used within the type system definition language to indicate deprecated portions of a GraphQL service’s schema, such as deprecated fields on a type or deprecated enum values.

@@ -332,6 +334,8 @@ Fields
* `name` must return a String.
* `description` may return a String or {null}.
* `inputFields`: a list of `InputValue`.
* Accepts the argument `includeDeprecated` which defaults to {false}. If
{true}, deprecated enum values are also returned.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
{true}, deprecated enum values are also returned.
{true}, deprecated fields are also returned.

@@ -392,6 +396,9 @@ Fields
* `defaultValue` may return a String encoding (using the GraphQL language) of the
default value used by this input value in the condition a value is not
provided at runtime. If this input value has no default value, returns {null}.
* `isDeprecated` returns {true} if this field or argument should no longer be used,
otherwise {false}.
* `deprecationReason` optionally provides a reason why this field or argument is deprecated.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
* `deprecationReason` optionally provides a reason why this field or argument is deprecated.
* `deprecationReason` optionally provides a reason why this input field or argument is deprecated.

@IvanGoncharov IvanGoncharov added the 💡 Proposal (RFC 1) RFC Stage 1 (See CONTRIBUTING.md) label Oct 24, 2018
@IvanGoncharov
Copy link
Member

@smitt04 Looks good so far, I left a few review feedbacks.
Next step would be to work on PR for graphql-js: https://github.com/graphql/graphql-js
Just create a draft PR and I will review it.

Also, we need to discuss it on WG, here is the next one:
https://github.com/graphql/graphql-wg/blob/master/agendas/2018-11-08.md
You can add yourself to attendees and a new item to agenda like this:
https://github.com/graphql/graphql-wg/pull/103/files

@IvanGoncharov IvanGoncharov added 💭 Strawman (RFC 0) RFC Stage 0 (See CONTRIBUTING.md) 🚀 Next Stage? This RFC believes it is ready for the next stage and removed 💡 Proposal (RFC 1) RFC Stage 1 (See CONTRIBUTING.md) labels Oct 24, 2018
@smitt04
Copy link
Contributor Author

smitt04 commented Oct 24, 2018

@IvanGoncharov I have update the PR with suggested fixes. I have also submitted a PR to graphql-wg.

I can start looking into graphql-js, although I haven't worked in javascript graphql for a couple years. I am mostly working with golang graphql as of late.

@IvanGoncharov
Copy link
Member

I can start looking into graphql-js, although I haven't worked in javascript graphql for a couple years. I am mostly working with golang graphql as of late.

NP, you can just open an issue on graphql-js and I will try to implement it before WG.

@tomasaschan
Copy link

I just want to cheer you on and add my hopes that this will be merged and added soon. 🙌

It's quite a wonderful feeling to realize you're missing a feature, and when you start looking for discussions about it you find this (on graphql/graphql-js#1560):

image

@Neitsch
Copy link

Neitsch commented Jan 6, 2019

Should we only allow the deprecated directive on nullable arguments? This can not be expressed in the directive definition, but logically that might make sense.

@Anufant
Copy link

Anufant commented Feb 20, 2019

@IvanGoncharov
Hi Ivan!
Could you tell me please, when this PR will be merged?
I want to deprecate some input arguments in my GQL schema very much :)

@ghost
Copy link

ghost commented Feb 20, 2019

I'm also really looking forward to this feature!

@IvanGoncharov
Copy link
Member

@Anufant We discussed it on the last WG and everyone agreed that this issue should be fast-tracked so it definitely going into next spec release. Not sure about the exact date since there are a few things we need to discuss and implement in graphql-js before merging this.
You can read about the necessary RFC stages here:
https://github.com/facebook/graphql/blob/master/CONTRIBUTING.md#rfc-contribution-champions

@tjkirch
Copy link

tjkirch commented Mar 22, 2019

Awesome, glad this is moving! Does that mean the "Next Stage?" tag can be updated to a later stage? :)

@dice14u
Copy link

dice14u commented Apr 10, 2019

What is the next step here, it seems it has a champion with smitt04 having written both the propsal here and a (now stale) implementation in graphql-js "discussed it on the last WG and everyone agreed .. definitely going into next spec release" sounds like acceptance by WG so stage 3. Is there something a community member can do to get this merged in on the fast tracked path ?

@IvanGoncharov IvanGoncharov added the 🚀 Next Stage? This RFC believes it is ready for the next stage label Oct 1, 2020
@IvanGoncharov IvanGoncharov changed the base branch from master to deprecate-args December 3, 2020 16:42
@IvanGoncharov IvanGoncharov changed the title Add to the @deprecated directive to allow deprecation of inputValues Allow deprecation of input values Dec 3, 2020
@IvanGoncharov IvanGoncharov merged commit 41ca330 into graphql:deprecate-args Dec 3, 2020
@vlad-accedo
Copy link

wow

@leebyron leebyron added 📄 Draft (RFC 2) RFC Stage 2 (See CONTRIBUTING.md) and removed 💡 Proposal (RFC 1) RFC Stage 1 (See CONTRIBUTING.md) 🚀 Next Stage? This RFC believes it is ready for the next stage labels Feb 4, 2021
@leebyron leebyron added this to the May2021 milestone Apr 6, 2021
leebyron pushed a commit that referenced this pull request Apr 22, 2021
Co-authored-by: Ivan Goncharov <ivan.goncharov.ua@gmail.com>
@smyrick
Copy link

smyrick commented Apr 30, 2021

FYI for those tracking the issue, it has not officially merged into the spec yet, it has just moved to the next stage. See the actual changes here: #805

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
📄 Draft (RFC 2) RFC Stage 2 (See CONTRIBUTING.md)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet