Closed thecodingwizard closed 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)
?
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)
You're right, I misread the condition there
https://github.com/algolia/gatsby-plugin-algolia/blob/master/gatsby-node.js#L169 looks like it should be
.some
instead of.every
.closes #128