-
Notifications
You must be signed in to change notification settings - Fork 207
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
[Enhancement]: $first & $after keywords in REST & GQL #2246
Comments
Great to see you logging this @JerryNixon. Revised specificationsIn your table there is a semantic mismatch between
The perfect solution is to fully adhere to both standards by:
Motivations
Notes(A) ASP.NET Core oData automatically exposes the CRUD for the tables but all the navigations must be manually coded. This is a major disadvantage compare to the old WCF Data Services and DAB. HTH |
Remember @raffaeler, we need a solution that is backwards compatible with existing users of DAB. I have revised the plan but still need to talk to the engineering team about this, too. Would appreciate any feedback. |
I understand the backward compatibility issues Jerry, but the compliance with standards should always come first. Even more when the original draft came from MS, even if oData was then given to oasis. I am open to discuss but I don't really see great options to avoid the breaking change out of versioning the api with some headers. |
This introduces
$take
/$skip
in DAB REST and GraphQL endpoints.$first
$after
$take
$first
)$skip
Syntax
Note that
$first
,$take
, and (later)$top
are all synonyms of the same operations.Benefits
The value of the
$first/$after
approach is that it allows developers to paginate in a reliable way. When the underlying collection changes, the next page is always the next page and does not reset because of ordinal position. In a busy table, this provides a consistent and non-jarring user experience.The value of the
$take/$skip
approach is that it allows developers to paginate in a simple way, often in order to virtualize large datasets in visualization objects. It does not account for underlying collection changes but does return a programmatic page. It operates identically to theTake()
andSkip()
LINQ methods in .NET languages.Bonus:
$take
/$skip
are both keywords in OData and represent common expressions.Proposed synonyms
The reason for synonyms would be to accommodate the OData specification.
$top
$first
$skiptoken
$after
Feedback
Customers have reported that using GraphQL keywords in REST endpoints instead of OData standard keywords causes some code to struggle when interacting with our endpoints. Other customers have reported that not supporting integer-based
$take
/$skip
disqualifies some UI components looking for the standard.The text was updated successfully, but these errors were encountered: