You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
The GraphQL request has the ability to specify an extensions block which may have some custom information needed by my subgraphs or it expects that to exist in the extensions block as well.
In order for me to get that info to subgraphs, I need to add a Rhai script or coprocessor that does the follow:
Parse the request.body.extensions on an incoming request (likely at the SupergraphRequest phase)
Choose which fields I want and save them into the context
Add a hook for SubgraphRequest which reads the context and saves specific fields into that subgraph request.body.extensions
Describe the solution you'd like
Similar to the configuration we can do today with HTTP headers in YAML, allow configuring which extensions keys can be forwarded
I can solve this today with Rhai or coprocesser but that requires some code when the logic here is the same as headers
Additional context
We need to be aware of not forwarding everything. APQs and Apollo put some things in the extensions so we want this configurable on a per field.
We also need to consider if we want to allow nested forwarding. Headers are just one key-value so that is easy. Extensions though can be nested objects so maybe for YAML we just support the root level, and more advanced uses require Rhai or Coprocessor.
We could maybe support a JSONPath selector though for simple value fowarding like how we support it for span attribute selection from the data response body
Is your feature request related to a problem? Please describe.
The GraphQL request has the ability to specify an
extensions
block which may have some custom information needed by my subgraphs or it expects that to exist in theextensions
block as well.In order for me to get that info to subgraphs, I need to add a Rhai script or coprocessor that does the follow:
request.body.extensions
on an incoming request (likely at theSupergraphRequest
phase)context
SubgraphRequest
which reads thecontext
and saves specific fields into that subgraphrequest.body.extensions
Describe the solution you'd like
Similar to the configuration we can do today with HTTP headers in YAML, allow configuring which extensions keys can be forwarded
Sample HTTP request
Sample future Router config
Describe alternatives you've considered
I can solve this today with Rhai or coprocesser but that requires some code when the logic here is the same as headers
Additional context
We need to be aware of not forwarding everything. APQs and Apollo put some things in the extensions so we want this configurable on a per field.
We also need to consider if we want to allow nested forwarding. Headers are just one key-value so that is easy. Extensions though can be nested objects so maybe for YAML we just support the root level, and more advanced uses require Rhai or Coprocessor.
We could maybe support a JSONPath selector though for simple value fowarding like how we support it for span attribute selection from the data response body
The text was updated successfully, but these errors were encountered: