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

Fix required fields regression #203

Merged
merged 6 commits into from
Feb 1, 2019
Merged

Fix required fields regression #203

merged 6 commits into from
Feb 1, 2019

Conversation

mattbretl
Copy link
Contributor

TODO:

  • Make sure all of the significant new logic is covered by tests
  • Rebase your changes on master so that they can be merged easily
  • Make sure all tests pass
  • Update CHANGELOG.md with your change
  • If this was a change that affects the external API, update the README

Fixes a regression of #63 introduced in v3.0.0

@benjie
Copy link
Contributor

benjie commented Jan 21, 2019

Can confirm that I have this issue too, and that Matt's fix (applied directly to node_modules) fixes it for me. The error is then caught by graphql/template-strings

Note it only wraps the code in an if block - use ?w=1 to ignore whitespace changes.

Copy link
Member

@abernix abernix left a comment

Choose a reason for hiding this comment

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

This LGTM to me with one nitty, formatting-related comment below, but a slight question as to whether or not this was intentional or not.

It looks like this was removed in 6886c0f#diff-95dbafa783634330b4c1ec80e94c9964L34.

@stubailo Do you have any recollection of a specific reason the if (!def) conditional might have been removed in the above commit?

[node]
)
);
if (def) {
Copy link
Member

Choose a reason for hiding this comment

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

Rather than indent entire block to encapsulate it with this if conditional, would it be possible to opt for the behavior that was here before which returned when def wasn't truthy?:

if (!def) {
return;
}

(In general, reducing over-indentation seems like a good principle to maintain.)

…early.

# Please enter the commit message for your changes. Lines starting
# with '#' will be ignored, and an empty message aborts the commit.
#
# HEAD detached at 6e694c9
# Changes to be committed:
#	modified:   customGraphQLValidationRules.js
#
Copy link
Member

@abernix abernix left a comment

Choose a reason for hiding this comment

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

LGTM.

@abernix abernix merged commit 4e2c9b1 into apollographql:master Feb 1, 2019
@abernix
Copy link
Member

abernix commented Feb 1, 2019

Thanks for opening this PR! I made a couple of formatting changes, but this has now landed in eslint-plugin-graphql@3.0.2.

@mattbretl mattbretl deleted the fix-required-fields-regression branch February 1, 2019 11:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants