-
Notifications
You must be signed in to change notification settings - Fork 349
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
connectionParams
for Subscriptions are not resolved
#5774
Comments
Could you provide a reproduction on CodeSandbox or StackBlitz? Thanks! |
Hi @ardatan, I have added a link to a GitHub repo and a CodeSandbox link in my post above. Unfortunately there is a problem with Yoga GraphiQL. But in every other GraphQL client it works. I hope this helps? |
Hmm YogaGraphiQL uses SSE not WS so there is no connectionParams in the context while connecting via SSE since it is still HTTP |
When I mount an AdditionalResolver in GraphQL Mesh that processes subscriptions, I have the |
I see. Currently Mesh's GraphiQL uses SSE only. This should be configurable in Mesh's configration file and GraphiQL needs to have a tab for connection params. |
I'm sorry, but I think we misunderstand each other. I don't use YogaGraphiQL and I don't want to. I have the problem with any client lib or app. Even from a React application. There I go via websockets ( Only the connection params passed by the client arrive at the GraphQL Mesh, but are not passed on to the Apollo. The values from the connection params ( |
Ok I understand. The GraphQL source doesn't receive the connection parameters. Is it possible for you to create a small reproduction on CodeSandbox or StackBlitz? |
I have added a React app to my example from above, which provides the correct connection parameters. Unfortunately they are not resolved correctly in GraphQL Mesh (see console log output from Apollo after the client connects). Unfortunately, I don't get Apollo, GraphQL Mesh and a Vite React app to launch in the CodeSandbox. But Apollo and GraphQL Mesh launch. If you copy the URL with port 4000 and give it locally in a client, you will see the problem too (instructions in the README). Of course you can also clone the repo and start everything locally including the React app. CodeSandbox: https://codesandbox.io/p/sandbox/github/roeb/graphql-mesh-apollo-sample/tree/main |
@ardatan any news? |
@roeb I have exactly the same problem! Did you found a solution? |
@roeb After hours of debugging and trying to understand how everything works together I hopefully found the solution. |
Issue workflow progress
Progress of the issue based on the
Contributor Workflow
Github,
CodeSandbox
Describe the bug
We want to use the GraphQL mesh to forward a subscription request to an Apollo GraphQL server behind it. The forwarding works and the subscription arrives successfully in Apollo.
However, we are missing the passed connection parameters. Here the interpolation does not seem to work. We could check with an additional resolver that the connection parameters sent by the client arrive successfully in the GraphQL mesh, but are not passed on to the Apollo.
The following arrives at the Apollo:
The headers for queries and mutations arrive successfully and correctly resolved at Apollo. The problem exists only for the connection parameters of subscriptions.
To Reproduce Steps to reproduce the behavior:
.meshrc.yml
Expected behavior
The GraphQL mesh should correctly resolve the connection parameters passed by the client and forward them to the Apollo server.
The following SHOULD be arrived in Apollo:
Environment:
@graphql-mesh/cli
: "^0.86.1",@graphql-mesh/graphql
: "^0.95.1",@graphql-mesh/plugin-operation-field-permissions
: "^0.95.1",@graphql-mesh/runtime
: "^0.96.1",@graphql-mesh/transform-filter-schema
: "^0.95.1",Additional context
The text was updated successfully, but these errors were encountered: