strawberry-sqlalchemy icon indicating copy to clipboard operation
strawberry-sqlalchemy copied to clipboard

Make Pagination Optional

Open fruitymedley opened this issue 9 months ago • 0 comments

Currently, pagination is configured for a model automatically if any relationship contains uselist=True, as seen in mapper.py:389. This seems undesirable as a strict rule, particularly in cases with a one-to-few relationship (think tires on cars). Obviously, there are cases where pagination is desirable (such as navigating a e-commerce catalog), so pagination should be toggleable.

Feature Request Type

  • [ ] Core functionality
  • [x] Alteration (enhancement/optimization) of existing feature(s)
  • [ ] New behavior

Description

  • Add a flag for pagination, which, when True, configures the schema using relay pagination for the field, and, when False, creates a simple array of objects for the field

Upvote & Fund

  • We're using Polar.sh so you can upvote and help fund this issue.
  • We receive the funding once the issue is completed & confirmed by you.
  • Thank you in advance for helping prioritize & fund our backlog.
Fund with Polar

fruitymedley avatar May 24 '24 18:05 fruitymedley