WIP: Input field deprecation support#3015
Conversation
rmosolgo
left a comment
There was a problem hiding this comment.
This looks perfect, thanks so much for knocking it out.
If the RFC is moved along and I miss it, just ping me here and I'll merge. (Honestly, this is a solid feature. I'd be happy to move faster than the RFC whenever you're ready to start using it!)
|
Thanks for this PR! Was just about to use it but then found out it's being worked on. |
|
Could really use this as well. |
|
@Marthyn / @rgraff - I wasn't in a rush to merge this since none of my clients currently leverage this information. Also the interaction with introspection is still undergoing some discussion. As written here and in graphql-js, marking an argument as deprecated will hide it from introspection queries (even if it's required) unless clients pass |
|
@jturkel I have a case for this as well, would love to see this merged! |
43df8d3 to
253a8c5
Compare
|
@rmosolgo - I've rebased this branch to resolve the merge conflict. We're going to hold off using this feature until graphql-js merges/releases graphql/graphql-js#1560 but I'm totally fine merging the graphql-ruby PR as-is if other folks want to use the feature sooner. |
|
@rmosolgo Any blockers here? I would love to use this feature. Thanks! |
|
@jturkel Looks like that PR you linked to has been open for two years. Any chance that this PR could get merged before that one? |
|
Looking forward on this feature!! |
# Conflicts: # spec/graphql/schema/argument_spec.rb
|
Looks like the graphql-js change merged in graphql/graphql-js#2733. The only change from what I implemented here is that you can't deprecate required arguments. I'll make that change tomorrow. |
|
👍 Thanks for the update, @jturkel . Could you @-me after pushing those changes? Sorry I've been slow to merge, I'll go ahead and merge it when that's taken care of. |
9520f98 to
4e2c13a
Compare
|
@rmosolgo - I added validation that deprecated arguments aren't required so this should be ready to go. I made that change in a separate commit for easier review but I'd be happy to rebase/squash to keep the master commit history clean if you want. |
|
Awesome, thanks again for your work on this! |
|
Anyone who wants to give this a try before the next release can pull the gem from github: gem "graphql", github: "rmosolgo/graphql-ruby" |
|
Awesome! Thank you! |
| } | ||
|
|
||
| input MyInput { | ||
| int: Int @deprecated(reason: "This is not the argument you're looking for") |
There was a problem hiding this comment.
This is not the argument I'm looking for.
This PR implements the RFC for input field deprecation support. The RFC was moved to stage 2 at the last working group. I don't think we want to merge this PR until the corresponding graphql-js PR merges (or the RFC moves to the accepted state) but I wanted to open a WIP PR in case there's an early feedback on my implementation and to prevent anyone from doing duplicate work.