The GraphQL Playground for the Keystone GraphQL API is located at localhost:4000/admin/graphiql. Here, we can test the list we created through the Keystone admin UI at localhost:4000/admin. Keystone will generate four top-level GraphQL queries automatically for every list that's created. For example, we will get the following queries for the page list we created in the previous section:
- allPages
This query can be used to fetch all the items from the Page list. We can also search, limit, and filter the result, as follows:
{
allPages (orderBy: "name_DESC", skip: 0, first: 6) {
title
content
}
}
- _allPagesMeta
This query can be used to fetch all meta-information about items in the Page list, such as the total count of all matched items, which can be useful for pagination. We can also search, limit, and filter the result, as follows:
{
_allPagesMeta (search: "a") {
count
}
}
- Page
This query can be used to fetch a single...