3 ms·
From what I can tell, PathQuery is also clever in how queries express the shape of the returned data, which we in GROQ call projection. For example, in GROQ you
by atombender 5y ago
From what I can tell, PathQuery is also clever in how queries express the shape of the returned data, which we in GROQ call projection. For example, in GROQ you can do:
*[type == "user"] {
id, name,
"slug": id + "-" + lower(name),
"photos": photos[] {
url, width, height
} | order(position),
"newestComment": *[_type == "comment" && author == ^.id] | order(createdAt desc)[0] {
id, body
}
}
PathQuery seems to give you similar tools in transforming data as part of your pipeline, which I think is how query languages should be like.