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

Fixed deprecation handling. #876

Merged
merged 9 commits into from
Jun 26, 2019
Merged

Fixed deprecation handling. #876

merged 9 commits into from
Jun 26, 2019

Conversation

michaelstaib
Copy link
Member

@michaelstaib michaelstaib commented Jun 26, 2019

The deprecation directive was not implemented as specified in the spec. With this PR we have now aligned how deprecation works with HC.

https://graphql.github.io/graphql-spec/draft/#sec--deprecated

DeprecationReason is now obsolete. In order to be more explicit I have introduced Deprecated for the code-first variant.

descriptor.Deprecated("reason") or descriptor.Deprecated() can be used to deprecate a field or enum value.

With code first we now are able to use @deprecated without any arguments.

@michaelstaib michaelstaib self-assigned this Jun 26, 2019
@michaelstaib michaelstaib added the 🐛 bug Something isn't working label Jun 26, 2019
@michaelstaib michaelstaib added this to the 9.1.0 milestone Jun 26, 2019
@michaelstaib
Copy link
Member Author

The schema serialization is now also tweaked and will not handle is deprecated as a special case anymore. Moreover, directives now do not serialize null arguments anymore. This makes the serialized schema much cleaner.

@michaelstaib
Copy link
Member Author

OK, there were a lot of tests to update due to the schema serializer changes. But I think the printed schemas are now much nicer.

@michaelstaib michaelstaib added the ⚖️ spec Implement or fix a GraphQL specification item. label Jun 26, 2019
@michaelstaib michaelstaib removed the request for review from nigel-sampson June 26, 2019 18:38
@michaelstaib michaelstaib merged commit 3529e78 into master Jun 26, 2019
@michaelstaib michaelstaib deleted the deprecated_directive_fix branch June 26, 2019 18:38
Copy link
Contributor

@nigel-sampson nigel-sampson left a comment

Choose a reason for hiding this comment

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

Looks good, have a couple of minor questions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛 bug Something isn't working ⚖️ spec Implement or fix a GraphQL specification item.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants