Skip to content

Allow using Loader with Permit.Ecto.Resolver #2

Description

@vincentvanbush

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: []

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions