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

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

Open
saiichihashimoto opened this issue Aug 29, 2023 · 0 comments
Open

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

saiichihashimoto opened this issue Aug 29, 2023 · 0 comments

Comments

@saiichihashimoto
Copy link
Contributor

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.

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

No branches or pull requests

1 participant