Intertwine order of optional field middleware with global field middleware
Nobody has claimed this yet.
- Dominant language
- PHP
- Stars
- 3.5k
- Forks
- 468
- Avg merge
- 3h 9m
- Merged PRs (30d)
- 2
Description
What problem does this feature proposal attempt to solve?
Since Lighthouse v5, it is possible to define the order of global field middleware: https://github.com/nuwave/lighthouse/pull/1533
However, this does not allow for optional field middleware - such as @guard - to be intertwined within the global field middleware. In the case of @guard, it may be particularly useful to run it before validation.
Which possible solutions should be considered?
Perhaps the config can have two lists of middleware:
- Global field middleware that should always be included, unordered
- Order of any field middleware present on a field
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
No files or tests are named. Start by reviewing the global field middleware ordering introduced in pull request #1533 and the current middleware configuration; done should allow optional middleware such as @guard to be positioned among global field middleware, with coverage for ordering it before validation.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- graphql, laravel, php
- Domain
- api, backend
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100