Description
Our use case is basically to paginate through all subcategories of a common parent category. For example to display all top level categories in a shop (men, women, etc.), we currently get the root category by ID and via the children attribute, retrieve all first level children. Pagination isn’t possible here. Depending on the customer, first level children categories might be hundreds or even more. Memory is not the issue but AEM wants to keep the request payload small and response times short (especially when GraphQL API is consumed client-side).
Would like to add the parent ID to the possible filters so you can directly get all first level children of the root category and pagination through it.
Adding parent_id to the filters should solve the issue.
<https://devdocs.magento.com/guides/v2.4/graphql/queries/categories.html]
Additions to schema:
input CategoryFilterInput
{ parent_id: FilterEqualTypeInput }
Expected Scenario:
{
categories(filters: {
parent_id: {
eq: "2"
}
}) {
items {
id
}
}
}
Response should return all the child categories belonging to the parent with id: "2".