Once you have root pages or any parent page, you can fetch their direct children to navigate deeper into your site's hierarchy. To retrieve the children of a specific page, use the following GraphQL query, providing the id
of the parent page:
query {
pages(filter: {parent_id: "1", lang: ""}, first: 25, page: 1) {
data {
id
related_id
parent_id
lang
path
domain
name
title
to
tag
theme
type
meta
config
content
status
cache
editor
created_at
updated_at
deleted_at
has
}
paginatorInfo {
currentPage
lastPage
total
count
perPage
}
}
}
This query uses the parent_id
within the filter
argument to specify that we want children of the page with ID "1". Other arguments like lang
, first
, and page
function the same way as in the "Fetch Root Pages" example. See PageFilter for all available filter options.
Example response:
{
"data": {
"pages": {
"data": [
{
"id": "2",
"related_id": null,
"parent_id": "1",
"lang": "",
"path": "blog",
"domain": "",
"name": "Blog",
"title": "Blog | PagibleAI CMS",
"to": "",
"tag": "blog",
"theme": null,
"type": null,
"meta": "{}",
"config": "{}",
"content": "[]",
"status": 1,
"cache": 5,
"editor": "aimeos@aimeos.org",
"created_at": "2023-04-01 09:02:25",
"updated_at": "2023-04-01 09:30:11",
"deleted_at": null,
"has": true
},
{
"id": "4",
"related_id": null,
"parent_id": "1",
"lang": "",
"path": "dev",
"domain": "",
"name": "Dev",
"title": "For Developer | PagibleAI CMS",
"to": "",
"tag": "",
"theme": null,
"type": null,
"meta": "{}",
"config": "{}",
"content": "[]",
"status": 1,
"cache": 5,
"editor": "aimeos@aimeos.org",
"created_at": "2023-04-01 09:02:25",
"updated_at": "2023-04-01 09:30:11",
"deleted_at": null,
"has": false
}
],
"paginatorInfo": {
"currentPage": 1,
"lastPage": 1,
"total": 2,
"count": 2,
"perPage": 100
}
}
}
}