GROQ - Is it possible to Order Items Conditionally Based on the Value of the Field?
Last updated: Jan 20, 2022
Is there a way using GROQ to order items conditionally based on the value of the field? e.g. the schema has a field “sorting” that can be ‘popularity’, ‘alpha’ or ‘price’, and the schema has a field with an array of references - is there a way to sort the references based on whatever the sorting is?
Jan 20, 2022, 10:03 AM
On a second thought, it’s probably best to do that on the client side.