-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Show deprecation information in the Docs sidebar #157
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 - and if you have received this in error or have any questions, please drop us a line at cla@fb.com. Thanks! |
Signed the CLA! A couple of notes about this patch also 😄
|
Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Facebook open source project. Thanks! |
Hi @davidcelis - thanks for contributing!
I think it's fine, although I'd like <DeprecatedReason markdown={field.deprecatedReason} /> I'm personally more attracted to the first approach of changing the component name.
My long-awaited goal... :p Would you be interested in becoming a pioneer and write tests for this?
This would be a bit tricky since the styling in A workaround to make this happen would be creating a new style in |
@@ -495,6 +495,8 @@ class TypeDoc extends React.Component { | |||
{argsDef && [ '(', <span key="args">{argsDef}</span>, ')' ]} | |||
{': '} | |||
<TypeLink type={field.type} onClick={onClickType} /> | |||
{field.isDeprecated && |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a small nit: I'd like to keep the brackets open/close using its own line
{
field.isDeprecated &&
<span ... />
}
9a03102
to
fb2f30d
Compare
@asiandrummer Thanks for the comments!
Done in 8cd42bc 😄
Agreed. I've renamed it to
I can try out a workaround, but it sounds like we'll be able to take care of this in a better way once the language service portion is moved out. I'm happy to help with the visual alteration once that happens! I was thinking a
I'm happy to lay some foundations for this, though I should probably also say that this is my first contribution to a React application. So that might take some extra time to learn how to do this 😄 |
Love the changes - would you mind squashing commits into a single one if possible? |
The GraphQL specification [states clearly](https://facebook.github.io/graphql/#sec-Deprecation): > Tools built using GraphQL introspection should respect deprecation by > discouraging deprecated use through information hiding or > developer‐facing warnings. Currently, however, GraphiQL doesn't give any indication of whether or not a field or enum value is deprecated. This patch rectifies this by adding some red text next to field names and enum value names that just says "(DEPRECATED)". If a deprecation reason is given for a field or enum value, that is rendered (also in red) underneath the field or value's description. Closes graphql#34. Signed-off-by: David Celis <me@davidcel.is>
fb2f30d
to
da68a51
Compare
Squashed! |
@davidcelis how exactly is this supposed to look like? I just upgraded and added a deprecated field. I am seeing the deprecation text in red when I click on the field but I am not seeing anything in the overview, where I have the list of field. Is that as expected? |
…transform-es2015-object-super-6.24.1 Update babel-plugin-transform-es2015-object-super to the latest version 🚀
The GraphQL specification states clearly:
Currently, however, GraphiQL doesn't give any indication of whether or
not a field or enum value is deprecated. This patch rectifies this by
adding some red text next to field names and enum value names that just
says "(DEPRECATED)". If a deprecation reason is given for a field or
enum value, that is rendered (also in red) underneath the field or
value's description.
Closes #34.
Signed-off-by: David Celis davidcelis@github.com