Skip to content

Commit

Permalink
Order input
Browse files Browse the repository at this point in the history
  • Loading branch information
gksander committed Aug 11, 2023
1 parent ac52632 commit 477eb39
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/early-spies-teach.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"groqd": patch
---

Addresses #213, allows the .order method to take an array of strings – since order argument can be more complex than just `FIELD desc`
2 changes: 1 addition & 1 deletion packages/groqd/src/builder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ export class ArrayQuery<T extends z.ZodTypeAny> extends BaseQuery<
});
}

order(...orderings: `${string} ${"asc" | "desc"}`[]): ArrayQuery<T> {
order(...orderings: string[]): ArrayQuery<T> {
return new ArrayQuery<T>({
...this.value(),
query: this.query + `|order(${orderings.join(", ")})`,
Expand Down

0 comments on commit 477eb39

Please sign in to comment.