-
-
Notifications
You must be signed in to change notification settings - Fork 53
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support relay for associations #25
Comments
Thanks to the amazing work from @dolfinus, we have the core support for relay in place, so all that is left is to make it work for relationships! |
I've decided that this is out of scope for the moment. The performance of running that many cursors is highly doubtful. For now, instead, you can simply hide those relationships and/or create a calculation that produces a matching type. |
What do you mean? |
Well, its not so much that there would be issues with performance above and beyond the obvious, but if you make one request that has a bunch of related cursors, to seek one cursor you'd need to make the entire request again, refetching all cursors. So its a more scalable approach to do that by using a non-nested field for each relationship you want to page through. (i.e use a filter on the |
But the same issue is possible with offset pagination, isn't it? |
Yeah, but I think people are less likely to use offset pagination on large datasets. I didn't mean to imply that we should never add relay for associations, just that I wasn't going to invest more in doing it now because it would be "better" to prefer top-level pagination. If you're interested in working on relay for associations (will have some difficult design considerations, but should be doable) I'm happy to reopen this and we could have that conversation. |
I've laid the groundwork for relay support, pushed to master now. There are three remaining steps:
:has_many
or:many_to_many
relationships, we need to wrap them in a connection if the destination action supports paginationThe text was updated successfully, but these errors were encountered: