-
-
Notifications
You must be signed in to change notification settings - Fork 569
print @deprecated directive when deprecationReason is empty string #631
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
Conversation
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.
Thanks for the PR!
The previous version probably contained a bug. We should allow $reason === '' and it should print @deprecated. I added suggestions inline.
Technically this is a breaking change but this will go to the next major so it's OK. But we should also add a note about this in https://github.com/webonyx/graphql-php/blob/master/CHANGELOG.md
|
Is there anything else you want me to do, here? 🙏 |
|
Great job! Let's ship it 🚢 And sorry for the delay. |
Why
if ($reason === '')can't betrueafterif (empty($reason))=> because
empty()already test all falsy values (including'')How
@deprecatedprinting behaviorremove the useless conditionreplaceempty()with=== null