To Whom It May Concern:
We have a WebClient based application which retrieves our ShipHero data. It submits queries and processes the returned GraphQL objects extracting all required data. The application works perfectly with all data collections like Products, Orders, Shipments, etc. with exceptions of Bills. The Bills query call does not fail but it always returns just the empty result.
When debugging the application we grabbed the query string submitted by the application and pasted it into the GraphiQL client and there the same query works perfectly returning the expected result. The same result is when going the opposite way: Cutting the successful query from GraphiQL and pasting it into the application which submits it to the ShipHero API which then returns an empty result.
The used query string:
{
bills(from_date: “2021-10-03T00:00”, to_date: “2021-12-04T00:00”) {
data(first: 10) {
pageInfo {
hasNextPage
endCursor
}
edges {
node {
id
legacy_id
status
customer_name
profile_name
created_at
due_date
amount
totals(first: 10) {
pageInfo {
hasNextPage
endCursor
}
edges {
node {
id
legacy_id
amount
label
category
quantity
}
}
}
}
}
}
}
}
The result produced by GraphiQL:
{
“data”: {
“bills”: {
“data”: {
“pageInfo”: {
“hasNextPage”: true,
“endCursor”: “YXJyYXljb25uZWN0aW9uOjk=”
},
“edges”: [
{
“node”: {
“id”: “QmlsbDozNTk2Mw==”,
“legacy_id”: 35963,
“status”: “paid”,
“customer_name”: “CurlKalon”,
“profile_name”: “UWS-CK”,
“created_at”: “2021-05-07T18:47:04”,
“due_date”: “2021-06-02”,
“amount”: “509.56”,
“totals”: {
“pageInfo”: {
“hasNextPage”: false,
“endCursor”: “YXJyYXljb25uZWN0aW9uOjA=”
},
“edges”: [
{
“node”: {
“id”: “RmVlQ2F0ZWdvcnlUb3RhbDoxMDU1NDE=”,
“legacy_id”: 105541,
“amount”: “509.56”,
“label”: null,
“category”: “order”,
“quantity”: 85
}
}
]
}
}
},
…
The result produced by the application when submitting exactly the same query string:
{“data”:{“bills”:{“data”:{“pageInfo”:{“hasNextPage”:false,“endCursor”:null},“edges”:}}}}
As an experienced developer I first looked for bugs in my code. However, I found none and the fact that the code works as designed without a single glitch with all other queries strongly implies that there must be some difference between Bills collection and other data. Nevertheless, it does not explain why the same query string works perfectly from GraphiQL and not from the WebClient.
Any help or suggestion with this issue would be greatly appreciated.
Martin Vanha