FormidableLabs / groqd

A schema-unaware, runtime and type-safe query builder for GROQ.
https://commerce.nearform.com/open-source/groqd
MIT License
222 stars 17 forks source link

Bug: Return New Class Instance on all Builder Methods #204

Closed maxyinger closed 11 months ago

maxyinger commented 1 year ago

Noticed we are mutating the query directly in some builder methods like slice & order. This can cause some irregular behavior depending on usage. Highlighted in this arcade example

We should update all methods to return a new instance of the class with the updated query vs mutating the internal query directly.