Skip to content

Add GetPagingArguments method to IResolverContext #3557

@tobias-tengler

Description

@tobias-tengler

At the moment I have to get arguments like "first" from the context myself.

var first = context.ArgumentValue<int?>("first");

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 GetPagingArguments to the IResolverContext, which would return the CursorPagingArguments. (GetOffsetPagingArguments respectively)

This would match AddPagingArguments nicely and would reduce boilerplate.

I think it could also be helpful, if these methods validate the arguments against the configured PagingOptions, i.e. DefaultPagingSize and MaxPagingSize.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Area: DataIssue is related to filtering, sorting, pagination or projections⌛ staleNothing happened with this issue in quite a while🌶️ hot chocolate🙋 good first issueGood for newcomers

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions