groq-js icon indicating copy to clipboard operation
groq-js copied to clipboard

Filter on a non-array should return the base value.

Open saiichihashimoto opened this issue 1 year ago • 0 comments


const query = "false[true]";
const tree = parse(query);
const result = await (await evaluate(tree)).get();

console.log(result);
// Should be false, is null

According to the GROQ spec's section on Filter, if the base is not an array, the base should be returned. In this case, it's returning a null, which isn't correct.

saiichihashimoto avatar Aug 29 '23 21:08 saiichihashimoto