ChilliCream / ChilliCream/graphql-platform

Easier access to Request's Filter values to enable conditional domain logic

Open
#9,441 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

🌶️ hot chocolate
Dominant language
C#
Stars
5.8k
Forks
810
Avg merge
15h 39m
Merged PRs (30d)
98

Description

Product

Hot Chocolate

Is your feature request related to a problem?

There are several advanced scenarios where we need to inspect the Request's filter values to either act on it or even move away from the default filtering for specific fields and implement a low-level, optimized filter instead.

First of all, is there specific Documentation or sample implementation to access the Filter paramaters that I may have missed?.

I've been able to access this information via a Middleware component deriving from ObjectFieldDescriptorAttribute and accessing and manually parsing the Filter AST tree from IMiddlewareContext .ArgumentLiteral<IValueNode>("where");, however this is very tedious and error prone, specially for Composite Filters with And, Ors etc.

The solution you'd like

A library-provided solution to access the Filter parameters in a:

  • Opt-In "only incur the performance cost of parsing it when asked to".
  • Type safe, .NET simple classes modelling of the filter parameters.

Additionally, a simple way to remove parameters for those scenarios where the application decides to take over the implemention of the filtering.

Thanks in advance.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the middleware component derived from ObjectFieldDescriptorAttribute and the IMiddlewareContext.ArgumentLiteral("where") access described in the issue. Review how filter AST values are currently parsed, then determine the scope of an opt-in typed API and parameter removal; done would require an agreed library design and implementation path.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp, graphql
Domain
api, backend
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Quiet
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.