The Metadata GraphQL implementation utilizies GraphQL's pagination convention using the GraphQL connection model. This means that every entity queried is embedded within a wrapper containing the pagination information. To learn more, see GraphQL Pagination.
GraphQL query enables you to sort and order your queries by using a set of predefined arguments. Available sort arguments are First (limit), After (Offset) and OrderBy.
For example, for Package pagination you can use: (first:5 after:$PackageCursor). The Package cursor is retrieved from the last Package queried. Additionally, you can get the last Package cursor and know if there are additional Packages to query by adding the pageInfo to your query.
Pagination Example
query
{
packages (
# filter argument
filter: {name: "*" },
first: 5,
after: "UGFja2FnZTo1"
)
{
pageInfo
{
hasNextPage
endCursor
}
# Connection Model
edges {
cursor
node {
#Object fields to be returned by the query
name
packageType
description
}
}
}
}