Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pass WebSocket connectionParams to downstream also in connectionParams #4305

Closed
enisdenjo opened this issue Aug 15, 2022 · 1 comment · Fixed by #4724
Closed

Pass WebSocket connectionParams to downstream also in connectionParams #4305

enisdenjo opened this issue Aug 15, 2022 · 1 comment · Fixed by #4724
Assignees

Comments

@enisdenjo
Copy link
Collaborator

Continuation task of #4040.

Currently the WebSocket connectionParams are spread to request headers and passed through the extensions field of GraphQL request parameters. This is a tad confusing, see #4040 (comment).

Instead, it would be great if we could make the connectionParams be in connectionParams downstream.

@ardatan
Copy link
Owner

ardatan commented Aug 15, 2022

You probably already know that but I am adding this just to clarify the issue; GraphQL Mesh's runtime has nothing to do with HTTP actually, because the runtime only generates a schema (and an executor), then that schema/executor is used as a standalone artifact, an SDK or by an HTTP server(Yoga, Apollo etc).
We don't forward HTTP requests as they are in GraphQL Mesh, because the consumer might not be an HTTP server.

Then how can we pass connectionParams from the gateway to the underlying WS sources?
We can basically have an additional field in the configuration like operationHeaders that passes connectionParams dynamically to graphql-ws client.

connectionParams:
    x-foo: `some-static-prefix-{context.connectionParams['my-foo']}` # String interpolation

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants