-
-
Notifications
You must be signed in to change notification settings - Fork 804
Add GetPagingArguments method to IResolverContext #3557
Copy link
Copy link
Closed
Labels
Area: DataIssue is related to filtering, sorting, pagination or projectionsIssue is related to filtering, sorting, pagination or projections⌛ staleNothing happened with this issue in quite a whileNothing happened with this issue in quite a while🌶️ hot chocolate🙋 good first issueGood for newcomersGood for newcomers
Milestone
Metadata
Metadata
Assignees
Labels
Area: DataIssue is related to filtering, sorting, pagination or projectionsIssue is related to filtering, sorting, pagination or projections⌛ staleNothing happened with this issue in quite a whileNothing happened with this issue in quite a while🌶️ hot chocolate🙋 good first issueGood for newcomersGood for newcomers
At the moment I have to get arguments like "first" from the context myself.
All of this is already handled inside the PagingHandlers. We could extract this logic and make it accessible to consumers of the library.
I propose to add a new extension method like
GetPagingArgumentsto theIResolverContext, which would return theCursorPagingArguments. (GetOffsetPagingArgumentsrespectively)This would match
AddPagingArgumentsnicely and would reduce boilerplate.I think it could also be helpful, if these methods validate the arguments against the configured
PagingOptions, i.e.DefaultPagingSizeandMaxPagingSize.