Allow nested relationship pagination
Is your feature request related to a problem? Please describe. This is a presequisite for https://github.com/ash-project/ash_graphql/issues/131, opening it here to focus the discussion on the core part
Describe the solution you'd like
It should be possible to paginate a relationship by passing an appropriate Query. This would allow to have pagination for nested relationships for extensions that support this (like, potentially, AshGraphql).
Express the feature either with a change to resource syntax, or with a change to the resource interface
Right now the only place where pagination can be configured is in action options, i.e. passing page: [offset: 3, limit: 10] to Ash.read or similar functions. To be able to setup pagination in nested loads, we will probably have to add some function and/or option on Query (and Changeset, since those have loads too). This should be similar to what is already done with, e.g., tenant, which can be set both on the Query and as an action option.
Potential syntax:
comment =
Comment
|> Query.set_page(after: comment_keyset, first: 10)
Post
|> Ash.Query.load(comment: comment)
|> Ash.read!()
This would be a welcome feature. I attempted to add this a long time ago, but the codebase wasn't in a good place for that. In its current state, I think it is much more doable. There may be some finicky bits since what must currently be a list could now be a page, but we can work those things out without too much hassle I think.
I guess we can close this as implemented in #1050 and #1183