Skip to content
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

Allow using Loader with Permit.Ecto.Resolver #2

Open
vincentvanbush opened this issue Jun 6, 2023 · 0 comments · May be fixed by #8
Open

Allow using Loader with Permit.Ecto.Resolver #2

vincentvanbush opened this issue Jun 6, 2023 · 0 comments · May be fixed by #8
Labels
enhancement New feature or request

Comments

@vincentvanbush
Copy link
Contributor

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: []
@vincentvanbush vincentvanbush added the enhancement New feature or request label Jun 6, 2023
@olafbado olafbado linked a pull request Feb 29, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant