Check isDeprecated instead of deprecationReason in printDeprecated#1035
Merged
leebyron merged 2 commits intographql:masterfrom Dec 1, 2017
Merged
Check isDeprecated instead of deprecationReason in printDeprecated#1035leebyron merged 2 commits intographql:masterfrom
leebyron merged 2 commits intographql:masterfrom
Conversation
|
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 [email protected]. Thanks! |
|
Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Facebook open source project. Thanks! |
Contributor
|
Thanks! |
etiennedi
added a commit
to weaviate/weaviate
that referenced
this pull request
Jan 13, 2021
So, this seems to boil down to the following: - There is an old bug in graphql-js (fixed in 2017) where the package ignores the isDeprecated field, but instead uses deprecationReason!=null to check whether a field is deprecated. This bug has been fixed a long time ago: graphql/graphql-js#1035 - However, it seems various other dependencies have not updated to include the fix, see graphql-go/graphql#504 (comment) - The graphql-go package has been (correctly) using an empty string (as is the default value for string) in Go if no deprecation reason is set. As "isDeprecated" this should not ever have mattered - Since the bug from bullet one still seems to be present in many packages - as we have seen with the latest GraphiQL reason - the graphql-go team have now instead added a new resolver which explicitly sets the "deprecationReason" to null (rather than "") if not set. This was released in v0.7.9 which this commit udpates to - This fixes our issue, the fields are no longer shown as deprecated in GraphiQL :)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
isDeprecatedis to determine deprecation instead ofdeprecatedReason.currently
"isDeprecated"is totally ignored, for example, if the input is like{"isDeprecated": false, "deprecationReason": "-"}it will be treated as deprecated, it is wrong.