Add properties to queries (i.e. add "TotalCount") #1912
Replies: 2 comments 4 replies
-
Hi @jacksorjacksor, thanks for the question. You could create a stored procedure with the logic for calculating the total count of people. This stored procedure can then be exposed an entity in the configuration file, which would enable the execution of a GraphQL query to fetch the total count. |
Beta Was this translation helpful? Give feedback.
-
I agree that it would be very helpful if the generated API included filtered table-or-view matching-count endpoints. In some scenarios, fetching the number of predicate-matching records within a table or a view (the count) is preferable to returning the filtered records themselves. I started to work around this issue by creating a single generic stored procedure for all of the exposed tables in the database. My intention was guard the execution of that SPROC using the same T-SQL logic that I also use to generate the app-specific Nevertheless, it would be very useful if the generated API supported submitting a complex hierarchical request to a GraphQL endpoint with predicates applied at different levels in the hierarchy and to request a response that returns the number of records which satisfy the predicate hierarchy rather than returning the records themselves. |
Beta Was this translation helpful? Give feedback.
-
Hi there!
We've been exploring DAB usage and have used it for building our root level query objects (i.e. "people", "person_by_pk" etc.).
However, we've been unable to work out how we can add custom logic/queries to these objects - for example, how to create a "total_count_of_people".
Could anyone give us advice on how we should be going about doing this?
TIA!
Rich
Beta Was this translation helpful? Give feedback.
All reactions