Skip to content

Commit

Permalink
.order input type (#214)
Browse files Browse the repository at this point in the history
Order input
  • Loading branch information
gksander authored Aug 11, 2023
1 parent ac52632 commit 600a5e4
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 600a5e4

Please sign in to comment.