to get a personalized navigation.
to get a personalized navigation.
Hey,
So there seems to be an issue with pagination when using groupBy and aggregations. The following query returns 75 records and hasNextPage: true, and an endCursor, but when I try to follow the end cursor it returns a database error.
The numeric value of the endCursor is interestingly enough 68, even though the query returns 75 records.
query GroupStockBalanceByProduct($cid: Int!, $excludeStock: [Int!], $after: String = null) {
useCompany(no: $cid) {
stockBalance(
filter: {warehouseNo: {_not_in: $excludeStock}},
groupBy: [{productNo: DEFAULT}],
after: $after
) {
totalCount
pageInfo {
hasNextPage
endCursor
}
items {
productNo
aggregates {
sum {
realisedStock
unrealisedStockIncrease
reservedFromStock
inHireOrder
inLoanOrder
inOrder
inOrderToProduction
inProduction
inPurchase
}
}
}
}
}
}
Error response
{
"errors": [
{
"message": "Error: SQL command no. 3010 failed.Database error.",
"extensions": {
"data": {
"status": 2,
"status_name": "DatabaseError"
}
}
}
],
"data": {
"useCompany": {
"stockBalance": {
"totalCount": 75,
"pageInfo": {
"hasNextPage": false,
"endCursor": null
},
"items": null
}
}
},
"extensions": {
"vbnxt-trace-id": "00000000000000001c430aae153278be"
}
}
Solved! Go to Solution.
Copyright © 2022 Visma.com. All rights reserved.