algolia / gatsby-plugin-algolia

A plugin to push to Algolia based on graphQl queries
https://yarn.pm/gatsby-plugin-algolia
Apache License 2.0
178 stars 45 forks source link

fix: fix enablePartialUpdates fields check, closes #128 #130

Closed thecodingwizard closed 3 years ago

thecodingwizard commented 3 years ago

https://github.com/algolia/gatsby-plugin-algolia/blob/master/gatsby-node.js#L169 looks like it should be .some instead of .every.

closes #128

Haroenv commented 3 years ago

I'm not sure this is right, the error is thrown when (!every), did you want to change it to (some) instead of (!some)?

thecodingwizard commented 3 years ago

We want to fail if no property in match fields exists in the object, right? So if .some returns false then no field exists ==> fail, if .some returns true then at least one field exists ==> pass.

Or is the intended behavior that all fields need to exist (in which case .every is correct, but the error message should be updated?)

(oops I haven't tested this code though)

Haroenv commented 3 years ago

You're right, I misread the condition there