Getit
Getit copied to clipboard
Regression in query building in 2.1822.0 version
Hi!
I recently updated the package version from 2.1603.0
to 2.1822.0
and my graphQL logic stopped working. All previous versions works fine for me. Apparantly some bug creeped in that last version.
I have following code:
var startDate = DateTimeOffset.UtcNow.AddDays(-1);
var endDate = DateTimeOffset.UtcNow;
var query = new Query()
.Name("query")
.Select(new Query()
.Name("publisherCommissions")
.Select(
"count",
"payloadComplete",
new Query()
.Name("records")
.Select("actionStatus", "actionTrackerId", "actionTrackerName",
"actionType", "advertiserId", "advertiserName", "commissionId",
"orderId", "postingDate", "pubCommissionAmountPubCurrency",
"saleAmountPubCurrency", "shopperId")
.ToString())
.Where("forPublishers", new[] { "123" })
.Where("sincePostingDate", startDate.ToString("yyyy-MM-ddTHH:mm:ssZ"))
.Where("beforePostingDate", endDate.ToString("yyyy-MM-ddTHH:mm:ssZ")))
.ToString();
which should generete query:
{
publisherCommissions(forPublishers: ["123"], sincePostingDate: "2019-08-08T13:02:54Z", beforePostingDate: "2019-08-09T13:02:55Z") {
count
payloadComplete
records {
actionStatus
actionTrackerId
actionTrackerName
actionType
advertiserId
advertiserName
commissionId
orderId
postingDate
pubCommissionAmountPubCurrency
saleAmountPubCurrency
shopperId
}
}
}
It successfully does that for 2.1603.0
version but, for 2.1822.0
version it generetes:
{
publisherCommissions(forPublishers: ["123"], sincePostingDate: "2019-08-08T13:07:12Z", beforePostingDate: "2019-08-09T13:07:12Z") {
count
payloadComplete {
records {
actionStatus
actionTrackerId
actionTrackerName
actionType
advertiserId
advertiserName
commissionId
orderId
postingDate
pubCommissionAmountPubCurrency
saleAmountPubCurrency
shopperId
}
}
}
}
which gives me an error since payloadComplete
is not a complex type but a boolean. The curly brackets should start from records
element not payloadComplete
.
Thanks for looking into it. For now, I will stay on previous version.