apache / incubator-kie-kogito-apps

Kogito Apps - Kogito is a cloud-native business automation technology for building cloud-ready business applications.
http://kogito.kie.org
Apache License 2.0
56 stars 125 forks source link

totalCount is missing in GraphQL response #2012

Open JudeNiroshan opened 4 months ago

JudeNiroshan commented 4 months ago

Describe the bug

Currently, it is possible to query the data using the Pagination schema. It provides

limit: int offset: int

However, it makes more sense when the caller knows the result count which satisfy the executed graphQl query.

Expected behavior

Response should contain the

totalCount

Actual behavior

No response

How to Reproduce?

No response

Output of uname -a or ver

No response

Output of java -version

No response

GraalVM version (if different from Java)

No response

Kogito version or git rev (or at least Quarkus version if you are using Kogito via Quarkus platform BOM)

No response

Build tool (ie. output of mvnw --version or gradlew --version)

No response

Additional information

No response

caponetto commented 4 months ago

Hi @nmirasch, could you please evaluate this request?

JudeNiroshan commented 3 months ago

@nmirasch any progress on this?

nmirasch commented 3 months ago

Hi @JudeNiroshan, we have been avoiding this total count queries regarding performance reasons. You can see the justification of this design here: https://github.com/apache/incubator-kie-kogito-apps/issues/1506#issuecomment-1324992472. To add this total count we need to explore what could be the best way to do that, GraphQL doesn't do this calculations and aggregations for you. One way would be to define a Type of aggregated data in Graphql and a function you want to implement to do the aggregation. For this reason we need to define what is exactly needed and define the specific solution for that purpose.