When you are requesting information from folio the results might seem like they are missing values. This is because the api returns results in a paginated format, with each page containing 100 values.
To get all values you will need to add the below pageInfo block to the top of any requests (before the edges) to get the cursor for the start and end of the current page.
For the below example I will get the first 100 fields on my template - and will have the endCursor to use to get the next 100 fields.
{
folioFields {
pageInfo {
endCursor
startCursor
}
edges {
node {
id
}
}
}
}
You then use these cursors in the requests to either get 100 before the cursor or 100 after the cursor.
Then I will use the after argument for the function to get the next 100 fields after the cursor I specified.
{
folioFields(after:"MzAw") {
pageInfo {
endCursor
startCursor
}
edges {
node {
id
}
}
}
}
The other basic arguments you can use for functions are as follows:
- After - Will return all elements after the specified cursor
- Before - Will return all elements before the specified cursor
- First - (requires a number - max 100) will return the first n elements from the list
- Last - (requires a number - max 100) will return the last n elements from the list.