rmosolgo / graphql-ruby

Ruby implementation of GraphQL
http://graphql-ruby.org
MIT License
5.38k stars 1.39k forks source link

Fix bug in DataLoader::Source#load_all when sending only falsy values #5167

Closed Baxxx closed 5 days ago

Baxxx commented 5 days ago

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.

rmosolgo commented 5 days ago

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?.