-
Notifications
You must be signed in to change notification settings - Fork 90
Description
Hi.
I've tried to use both absinthe-relay (for pagination) and dataloader (for handling N+1 problem) in the same project.
But I haven't found some working way to combine them in the documentation.
So I've impletented a simple helper module which allows to integrate these libraries wich each other:
https://github.com/dolfinus/arkenston-backend/blob/8a9dce9ae09da7341a6e3ea54be9106358cbc7ec/lib/arkenston_web/schema/helpers/pagination.ex#L16-L40
https://github.com/dolfinus/arkenston-backend/blob/8a9dce9ae09da7341a6e3ea54be9106358cbc7ec/lib/arkenston_web/schema/helpers/association.ex#L12-L16
https://github.com/dolfinus/arkenston-backend/blob/8a9dce9ae09da7341a6e3ea54be9106358cbc7ec/lib/arkenston/helper/query_helper.ex#L242
Now I can use paginated macros like:
https://github.com/dolfinus/arkenston-backend/blob/8a9dce9ae09da7341a6e3ea54be9106358cbc7ec/lib/arkenston_web/schema/helpers/revision.ex#L35
https://github.com/dolfinus/arkenston-backend/blob/8a9dce9ae09da7341a6e3ea54be9106358cbc7ec/lib/arkenston_web/schema/query/user.ex#L15
How about to include such a helper to absinthe-relay? IMHO, it'll be helpful.