router
router copied to clipboard
Ability to modify request post parsing, but pre-supergraph service
Currently, APQ, PQ, and Query Analysis happens inside the RouterService. Those different layers are able to either:
- Give back a transformed (or not) supergraph::Request (in the Ok case)
- A supergraph::Response, which is immediately returned by the router service, before calling the supergraph service (in the Err case)
While this works well, it does mean it is hard for plugin owners to transform a supergraph::Request before it gets to those layers. This could be useful for various query transformations, implementing custom PQ-ish protocols, etc. The alternative is to either fully take control of the router service (unwise), or make these transforms to the router::Request itself, which requires parsing the body / constructing expensive structures.
An additional plugin hook, a "transform service" of some kind would be great.