-
Notifications
You must be signed in to change notification settings - Fork 107
API endpoints
Ammar K edited this page Nov 22, 2021
·
2 revisions
-
/rest/V1/menus
- retrieves available menus -
/rest/V1/nodes
- retrieves nodes by menuId
Queries HTTP method must be GET
in order to cache their results.
Returns a list of active menus filtered by the array argument identifiers
.
query SnowdogMenusExample {
snowdogMenus(identifiers: ["foo", "bar"]) {
items {
menu_id
identifier
title
css_class
creation_time
update_time
}
}
}
The identifiers
argument is optional, so it's possible to retrieve a list of all active menus if the argument is omitted:
query SnowdogMenusExample {
snowdogMenus {
items {
menu_id
identifier
title
css_class
creation_time
update_time
}
}
}
The menus can also be optionally extended by adding the node trees to them:
query SnowdogMenusExample {
snowdogMenus(identifiers: ["foo", "bar"]) {
items {
menu_id
identifier
title
css_class
creation_time
update_time
nodes {
items {
node_id
menu_id
type
classes
parent_id # Parent node ID
position
level
title
node_template
submenu_template
creation_time
update_time
additional_data
... on SnowdogMenuNodeContentFieldInterface {
content
}
... on SnowdogMenuNodeImageFieldInterface {
image
image_alt_text
}
... on SnowdogMenuCustomUrlNode {
target # (false for "_self", true for "_blank")
}
}
}
}
}
}
Returns a list of active menu nodes filtered by the menu identifier
argument.
query SnowdogMenuNodesExample {
snowdogMenuNodes(identifier: "foobar") {
items {
node_id
menu_id
type
classes
parent_id # Parent node ID
position
level
title
node_template
submenu_template
creation_time
update_time
additional_data
... on SnowdogMenuNodeContentFieldInterface {
content
}
... on SnowdogMenuNodeImageFieldInterface {
image
image_alt_text
}
... on SnowdogMenuCustomUrlNode {
target # (false for "_self", true for "_blank")
}
}
}
}