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 bug in DataLoader::Source#load_all when sending only falsy values #5167

Merged
merged 1 commit into from
Nov 21, 2024

Conversation

Baxxx
Copy link
Contributor

@Baxxx Baxxx commented Nov 21, 2024

In ruby:

[nil].any? #=> false
[false].any? #=> false

When sending [nil] to load_all, it was making the source think that there are no pending keys, and raised GraphQL::InvariantError.

In ruby:
```rb
[nil].any? #=> false
[false].any? #=> false
```

When sending [nil] to load_all, it was making the source think that
there are no pending keys, and raised GraphQL::InvariantError.
## To finalize your edit, press ctrl+Enter.  To cancel, close the view.
@Baxxx Baxxx force-pushed the fix_load_all_for_nils branch from 4573411 to cc2fbb7 Compare November 21, 2024 14:45
@rmosolgo
Copy link
Owner

Thanks for this fix! I have a Rubocop rule that checks for .none? for the same reason, I'm going to update it to also check for .any?.

@rmosolgo rmosolgo merged commit 1351395 into rmosolgo:master Nov 21, 2024
11 of 15 checks passed
@rmosolgo rmosolgo added this to the 2.4.5 milestone Nov 21, 2024
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.

2 participants