Azure / data-api-builder

Data API builder provides modern REST and GraphQL endpoints to your Azure Databases and on-prem stores.
https://aka.ms/dab/docs
MIT License
787 stars 142 forks source link

[Enhancement]: hasPreviousPage / Before Cursor not found #2238

Open irushabh opened 1 month ago

irushabh commented 1 month ago

What happened?

There is no way to get or return hasPreviousPage or Before cursor while using GraphQl in DAB config endpoint.

Version

Microsoft.DataApiBuilder 0.11.132+f517dcb8dfe5926d15c24c2ea544dbc3005ee6d1

What database are you using?

Azure SQL

What hosting model are you using?

Local (including CLI), Container Apps

Which API approach are you accessing DAB through?

GraphQL

Relevant log output

No response

Code of Conduct

frekvent-szabolcs commented 1 month ago

Having a before cursor would be useful for implementing traditional "next" and "previous" page pagination. However, to implement pagination like the one shown below: image we would need additional features. Specifically, we would need either a way to pass an offset parameter and request the total count, or another method to access metadata about the pagination. This would allow us to construct the endCursor ourselves.

Discussions about this issue: https://github.com/Azure/data-api-builder/discussions/2088 https://github.com/Azure/data-api-builder/discussions/2234

seantleonard commented 1 day ago

Thank you for the suggestion, I'm now tracking this in our backlog. FYI @jerrynixon