Open mydearxym opened 6 years ago
@mydearxym you couldn't use assoc
because pagination strategies depend of your application.
How to do it?
Pretty much create some resolver that send back the data as you need it for be able to send the pagination object back and create the related schema for it
That pagination object depends of the strategy you are using, for example, cursor based vs limit-offset based pagination.
@yordis yes i could do the pagination logic my self like :
field :posts, list_of(:post) do
arg :offset, :integer, default_value: 0
arg :limit, :integer, default_value: 20
resolve &Resolver.blabla/3
end
i love the assoc
for both save me a lot of typing and builds a resolution function which calls ecto_batch/4.
magic, but what's the point if assoc
do not support pagination in many_to_many situation ?
@mydearxym pagination is based on your application strategy, at that moment when absinthe add it, it will dictate how my application works.
Right now assoc
is a simple as it should be. That is an application specific details and we will get into the nightmare of convention.
If you want to save time, just write your own resolver that deals with exactly what you always do.
The point of assoc
is to be as simple as it gets for the basic uses cases.
hi guys ~
let's say i have a post type with many started_users field witch resolved by
assoc
macro, it's great , but how to do pagination in this situation ?