Skip to content

Commit 14ac061

Browse files
authored
docs: add graphql multi-field sort note (#15123)
### What? Adding a note to the sorting docs that you can sort on multiple fields in the GraphQL endpoint. ### Why? I was confused about how to do this in the GraphQL API because you can't pass in an array there. Adding a specific note will help future travelers. **Edit:** I just reread the docs and see that it's there under the REST API heading. I feel the note still adds something.
1 parent 25813a7 commit 14ac061

1 file changed

Lines changed: 12 additions & 0 deletions

File tree

docs/queries/sort.mdx

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,3 +101,15 @@ query {
101101
}
102102
}
103103
```
104+
105+
To sort by multiple fields in GraphQL, pass a comma-separated list:
106+
107+
```ts
108+
query {
109+
Posts(sort: "priority,-createdAt") {
110+
docs {
111+
color
112+
}
113+
}
114+
}
115+
```

0 commit comments

Comments
 (0)