graphql-platform icon indicating copy to clipboard operation
graphql-platform copied to clipboard

Manually create expression tree from filter input

Open sjroesink opened this issue 4 years ago • 5 comments

Is your feature request related to a problem?

Currently filtering only seems to work when returning an IQueryable. However, I'm calling a service that does not return a IQueryable; it does however accept a collection of Expressions as a parameters (which are in turn applied to a IQueryable inside that service).

The solution you'd like

I'd be great if there would be a way to manually build the expression tree based on a filter input parameter so I can do something like:

public Task<IEnumerable<User>> GetUsersAsync([Service] IUserService service, UserFilterInput filter) 
{
    return service.GetAllAsync(filter.ToExpressions());
}

Product

Hot Chocolate

sjroesink avatar Nov 05 '21 08:11 sjroesink

Filtering actually can work on anything ... However it is often complex to implement a filtering provider and we see that. @PascalSenn and I have discussed working on a filter object that can be passed into business logic or translated to an object that can then be passed into business logic.

We have not yet a target date for this, I will put it for now on the 13.0 milestone but we might put it into a dot release for 12.

michaelstaib avatar Nov 05 '21 09:11 michaelstaib

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar May 04 '22 13:05 stale[bot]

The filter object concept is very interesting to me, would be useful in my current project.

Is there another ticket that covers this idea? Dunno if anyone has had time to write up their thoughts on this.

treymack avatar May 04 '22 23:05 treymack

@sjroesink Have you tried this solution? Link

NikitaSTets avatar May 12 '22 20:05 NikitaSTets

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Sep 09 '22 21:09 stale[bot]