Closed krispetkov closed 3 months ago
Ok, I think I found the reason. It seems you don't have to have the entire response as a structure. It seems some kind of wrapping happens along the way and the Data
and Extensions
levels are obsolete, they are being added by the logic automagically. So to make it work instead of this struct:
type getOrderFulfilmentIDResp struct {
Data struct {
Order struct {
FulfillmentOrders struct {
Nodes []struct {
ID string `json:"id"`
} `json:"nodes"`
} `json:"fulfillmentOrders"`
} `json:"order"`
} `json:"data"`
}
you need to use this one:
type getOrderFulfilmentIDResp struct {
Order struct {
FulfillmentOrders struct {
Nodes []struct {
ID string `json:"id"`
} `json:"nodes"`
} `json:"fulfillmentOrders"`
} `json:"order"`
}
When trying to execute the following query:
The returned response is not being decoded correctly to the struct correctly.
Response:
Struct:
The
Nodes
array is always empty and no errors are available. I checked that the returned response/json has values, seems that decoding is not working for some reason...Tried it with
v3
andv4
and getting the same result.