Edit
The problem seems to have solved itself. I assume it was a temporary issue with the graphql server
When requesting a collection and it’s products from the storefront API, The first query is successful and will return the correct results, but when I request the second page (first N products after end cursor), this error is returned: “message”: “Invalid cursor for current pagination sort.”
Here is an example of an initial query and result:
query CollectionByHandle($handle: String!) {
collectionByHandle(handle: $handle) {
handle
id
products(first: 3, filters: {productType: "Vinyl Decal"}) {
pageInfo {
endCursor
hasNextPage
hasPreviousPage
startCursor
}
edges {
node {
id
handle
availableForSale
title
}
}
}
}
}
and the initial result:
{
"data": {
"collectionByHandle": {
"handle": "outdoors",
"id": "gid://shopify/Collection/471395467548",
"products": {
"pageInfo": {
"endCursor": "eyJsYXN0X3ZhbHVlIjoiMiIsImxhc3RfaWQiOjkzOTUxNDk0MzkyNjB9",
"hasNextPage": true,
"hasPreviousPage": false,
"startCursor": "eyJsYXN0X3ZhbHVlIjoiMCIsImxhc3RfaWQiOjkzMzQ3NTkyMjc2NzZ9"
},
"edges": [
{
"node": {
"id": "gid://shopify/Product/9334759227676",
"handle": "trippy-magic-skull-decal",
"availableForSale": true,
"title": "Trippy Magic Skull - Decal - Customizable"
}
},
{
"node": {
"id": "gid://shopify/Product/9395147145500",
"handle": "bird-flowers-decal",
"availableForSale": true,
"title": "Bird & Flowers - Decal"
}
},
{
"node": {
"id": "gid://shopify/Product/9395149439260",
"handle": "graphite-flower-decal",
"availableForSale": true,
"title": "Graphite Flower - Decal"
}
}
]
}
}
}
}
But, if I then request the next page:
query CollectionByHandle($handle: String!) {
collectionByHandle(handle: $handle) {
handle
id
products(
first: 3
filters: {productType: "Vinyl Decal"}
after: "eyJsYXN0X3ZhbHVlIjoiMiIsImxhc3RfaWQiOjkzOTUxNDk0MzkyNjB9"
) {
pageInfo {
endCursor
hasNextPage
hasPreviousPage
startCursor
}
edges {
node {
id
handle
availableForSale
title
}
}
}
}
}
This I receive this error:
{
"data": {
"collectionByHandle": null
},
"errors": [
{
"message": "Invalid cursor for current pagination sort.",
"locations": [
{
"line": 5,
"column": 5
}
],
"path": [
"collectionByHandle",
"products"
]
}
]
}
It was all behaving as expected when I last used it 2 days ago, and as of this morning, this error has started to appear. I may be missing something, and if I have left out any info I can try to provide it. Any insight would be appreciated, thanks