Skip to content
GitLab
Explore
Projects
Groups
Snippets
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
David Kosztka
Pod
Commits
b89dced0
Commit
b89dced0
authored
3 years ago
by
Alp Deniz Ogut
Browse files
Options
Download
Email Patches
Plain Diff
Add filters and sorting to docs
parent
2c2e25ac
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
docs/GraphQL.md
+40
-3
docs/GraphQL.md
with
40 additions
and
3 deletions
+40
-3
docs/GraphQL.md
+
40
-
3
View file @
b89dced0
...
...
@@ -61,8 +61,45 @@ Pagination is possible by using limit and offset variables in a query.
}
```
## Metadata
Aside from the data itself, one can request other metadata as well.
## Filters
Items can be filtered by a variaty of operators, namely eq, ne, gt, lt, gte, lte, and, or.
```
json
{
query
{
Account
(filter:
{
dateCreated:
{
gte:
1654784703
}}
)
{
displayName
}
}
}
```
Filters can be applied to edges as well:
```
json
{
query
{
Person
{
~owner
(filter:
{
displayName:
{
eq:
"Alice"
}}
)
{
displayName
}
}
}
}
```
## Sorting
To sort items "order_desc" and "order_asc" arguments are available.
```
json
{
query
{
Account
(order_desc:
dateCreated)
{
id
displayName
}
}
}
```
## Metadata (Not yet implmented)
Along with the data itself, one can request other metadata.
```
json
{
query
{
...
...
@@ -95,7 +132,7 @@ Those GraphQL queries above are wrapped around to conform to the usual HTTP API
Message (limit: 2) {
subject
service
sender (displayName: memri) {
sender (
filter: {
displayName:
{eq: "
memri
"}}
) {
displayName
}
}
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment
Menu
Explore
Projects
Groups
Snippets