Expose APIs to select distinct matching values for a filtered table-or-view column #1926
CalvinQuark
started this conversation in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
It would be useful if generated APIs facilitated submission of a complex hierarchical request to a GraphQL endpoint with predicates applied at different levels in the hierarchy and with the response containing only the distinct values for a specified top-level column drawn from records which satisfy the predicate hierarchy. I.e., the column's distinct values in the context of the applied filters.
I have started to work around this issue by creating a single generic stored procedure for all of the exposed tables in the database. My intention is guard the execution of this SPROC using the same T-SQL logic that I also use to generate the app-specific
entities
node in thedab-config.json
andstaticwebapp.database.config.json
files.For reference, here is the as-yet incomplete implementation:
If the API Builder generated these Select Distinct APIs, they would likely be used in various ways. One way would be to support a panel of filter widgets where each filter widget requests distinct values for a particular column predicated by all the other applied filters. I.e., they are all targeting different columns of the same table or view.
Beta Was this translation helpful? Give feedback.
All reactions