Got another graphql bug for you ![]()
I have the following graphql query:
query getOrders($first: Int, $after: String, $before: String, $query: String, $last: Int) {
orders(
first: $first
last: $last
sortKey: CREATED_AT
reverse: true
after: $after
before: $before
query: $query
) {
pageInfo {
hasNextPage
hasPreviousPage
startCursor
endCursor
}
nodes {
id
name
email
createdAt
displayFulfillmentStatus
customerLocale
shippingAddress {
company
address1
address2
city
province
zip
city
firstName
lastName
country
countryCodeV2
}
shippingLine {
code
}
}
}
}
{
"query": "(fulfillment_location_id:67228467415) AND (fulfillment_status:unshipped OR fulfillment_status:partial)",
"first": 20
}
The query returns 9 orders, however the pageinfo is wrong.
{
"hasNextPage":true,
"hasPreviousPage":false,
"endCursor":"eyJsYXN0X2lkIjo1MjA2NzAwOTQ5NzE5LCJsYXN0X3ZhbHVlIjoxNjg2NTYzNTU4MDAwfQ==",
"startCursor":"eyJsYXN0X2lkIjo1MjU0NzcwNTI0Mzc1LCJsYXN0X3ZhbHVlIjoxNjkxMDU3MzM3MDAwfQ=="
}
x-request-id: ba04b6e0-aa3c-4a7a-a825-bebad08f5caf
if I request 50 orders the page info is correct, in that there is only the one page of results, which also has 9 orders.
Running the query in graphiql app with read_all_orders with the same query, with first:20 I get indeed more than 20 results and the pagination is correct. If I boost the limit up to 50 (first:50) I only get 1 page of results which is also correct.
Could it be that that page_info is being calculated/generated before the access scope is being applied? I think this problem is relatively new or I think I would have noticed ..
Cheers,
Gary