stas / jsonapi.rb

Lightweight, simple and maintained JSON:API support for your next Ruby HTTP API.
MIT License
262 stars 58 forks source link

Includes don't seem to get paginated? #67

Closed jmdfm closed 2 years ago

jmdfm commented 3 years ago

If you set up pagination on your primary resource, it gets paginated fine. Now imagine that someone includes a relationship in the query, and that result set is in the 1000s.

What I see happening right now is that the top level resource is paginated correctly, but any included fields are fetched in total with no pagination whatsoever.

Is this expected? How can it be made so that anything included is also paginated correctly?

stas commented 2 years ago

Hi @johnmcdowall

Apologies for the late reply.

I don't think the spec is covering this aspect, ultimately the includes should be limited to the relevant records withing the current page.

Feel free to reopen this if you find something is off :bow: