GraphQL API
Search…
Categories
Each product has a category assigned and minimum one subcategory, but it can have several.
Suppliers can adjust global categories to all its products.

Get all categories

1
query Categories {
2
Categories {
3
id
4
name
5
subcategories {
6
id
7
name
8
}
9
}
10
}
Copied!
Response:
1
{
2
"data": {
3
"Categories": [
4
{
5
"id": "1",
6
"name": "Fitness",
7
"subcategories": [
8
{
9
"id": "1",
10
"name": "Gym"
11
},
12
{
13
"id": "2",
14
"name": "Food"
15
}
16
]
17
},
18
{
19
"id": "2",
20
"name": "Fashion",
21
"subcategories": [
22
{
23
"id": "3",
24
"name": "Clothes"
25
},
26
{
27
"id": "4",
28
"name": "Shoes"
29
}
30
]
31
},
32
...
33
]
34
}
35
}
Copied!

Get one category

It is also possible to get a category along with all its related subcategories.
The query will require only one input field as an argument:
  • categorybyIdId: the unique category ID.
1
{
2
"categorybyIdId": "1"
3
}
Copied!
1
query CategorybyID($categorybyIdId: ID!) {
2
CategorybyID(id: $categorybyIdId) {
3
id
4
name
5
subcategories {
6
id
7
name
8
}
9
}
10
}
Copied!
Response:
1
{
2
"data": {
3
"Category": {
4
"id": "1",
5
"name": "Fitness",
6
"subcategories": [
7
{
8
"id": "1",
9
"name": "Gym"
10
},
11
{
12
"id": "2",
13
"name": "Food"
14
}
15
]
16
}
17
}
18
}
Copied!