-
Notifications
You must be signed in to change notification settings - Fork 332
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[oData Handler] Count Not Behaving as Expected #944
Comments
Same problem on my app using this handler. Are there any updates on this issue? Regards |
Could you help us to reproduce it with our examples? |
@ardatan It is exactly as @cpoliver wrote. Query
Request Response odata service ("count" present)
Response graphql mesh handler ("count" not present)
|
Additionally, it seems that "$count" causes the other parameters (e.g. "$filter") to be discarded in some cases, and thus always returns the total count. I don't know if this is how it should be according to the odata protocol, but our SAP odata service does not discard them when called directly and returns the correct count. Query
Response graphql mesh handler
|
Suggestion
In my case the odata service always returns type String not type Int:
|
Following #864 I've got the latest version of the oData handler and GraphQL Mesh running and can confirm that both
count
andinlineCount
are now validQueryOptions
.However, using the
count
query option doesn't seem to do anything, and running the separate generated query with the same filter does not apply the filter. In fact, the filter appears to be ignored completely in the count query (TenanciesCount
), because you can pass an invalid oData filter string and nothing happens, whereas you get an error if you pass it to the main (Tenancies
) query.Here is an example of my query:
Which returns:
I'm not sure how I can get the count of the total number of filtered results, so I can handle pagination on the client side.
In the example above I'd TenanciesCount to be 1 in the example above, as there is 1 result for that given filter, and 4 results when the filter is not applied. Also, as an example, if there were 200 results when applying the filter, and I also requestion the
top: 10
in thequeryOptions
, I'd still expect a count of 200 as this is the total amount of results, which is required to calculate the pagination.I hope that contains enough information. Pinging @ardatan who was discussing this with me and asked me to raise an issue.
Thanks in advance!
The text was updated successfully, but these errors were encountered: