Currently, when resolving via Permit.Ecto.Resolver, it is not possible to use loader as defined in vanilla Permit, because it is fully replaced with base_query and finalize_query.
It would be useful for the developer to be able to use loader in special cases instead of base_query even if Ecto is in play, but there has to be a discussion about what API to use.
It could be rather problematic to allow using both functions, but something that has crossed my mind would be that a resolver could configure a pipeline like this:
# Ecto resolver
def pre_pipeline(...), do: [&base_query/4, &loader/4]
def post_pipeline(...), do: [&finalize_query/5]
# Vanilla resolver
def pre_pipeline(...), do: [&loader/4]
def post_pipeline(...), do: []
Currently, when resolving via
Permit.Ecto.Resolver, it is not possible to useloaderas defined in vanilla Permit, because it is fully replaced withbase_queryandfinalize_query.It would be useful for the developer to be able to use
loaderin special cases instead ofbase_queryeven if Ecto is in play, but there has to be a discussion about what API to use.It could be rather problematic to allow using both functions, but something that has crossed my mind would be that a resolver could configure a pipeline like this: