m4riok / strawberry-django-extras

Nested Mutations / Input Validation / Permissions on Inputs / Pre - Post Hooks for Mutaions and JWT authentication built ontop of Strawberry and Strawberry Django
MIT License
7 stars 1 forks source link

Pagination limit #1

Closed jcuenod closed 11 months ago

jcuenod commented 11 months ago

Is it possible to set a limit to the size of the limit?

m4riok commented 11 months ago

Hi @jcuenod

I am using the default offset limit pagination from strawberry-graphql-django and just wrapping it's result. As far as I know this feature is not supported.

You could make a tiny field extension to check the limit provided and throw an exception or even modify it. Take a look at the documentation on field extensions. It should be easy enough to implement. Just make sure you add it in the correct order so it runs prior to the with_total_count() extension.

jcuenod commented 11 months ago

Thanks, I'll look into that option!

jcuenod commented 11 months ago

Fyi, this was successful. Thanks!

m4riok commented 11 months ago

Thanks for letting me know.