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

[GROQ] Why can't I project a primitive to an object? #115

Open
romanlamsal opened this issue Nov 22, 2023 · 0 comments
Open

[GROQ] Why can't I project a primitive to an object? #115

romanlamsal opened this issue Nov 22, 2023 · 0 comments

Comments

@romanlamsal
Copy link

romanlamsal commented Nov 22, 2023

When executing the query

1 | { "foo": "bar" }

I would expect to receive { "foo": "bar" } as a result, yet the above will just be null. In the same vein, when executing

1 { "value": @ }

I would expect to receive { "foo": 1 }. Neither is happening, why?

I first thought @ might not be the right variable - but executing [1, 2, 3][@ > 2] will result in [3] which, on the other hand, is absolutely what I would be expecting.

@bjoerge bjoerge transferred this issue from sanity-io/sanity Nov 29, 2023
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