Mesh subscriptions returning an error #4867
Unanswered
platoyuval
asked this question in
General
Replies: 2 comments
-
It seems similar to this past issue: https://github.com/Urigo/graphql-mesh/pull/4270/commits |
Beta Was this translation helpful? Give feedback.
0 replies
-
I actually found a workaround by passing const client = createClient({
url: 'ws://localhost:4200/graphql',
webSocketImpl: WebSocket,
connectionParams: {
headers: {
authorization: 'blah'
}
}
}) It now works! But I think the graphql mesh code needs to be fixed to make the connectionParams optional. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I have a simple mesh with only one underlying service. It is an Apollo GraphQL server with a schema that has one query and one subscription (based on a public example), with CORS disabled (set to
true
).When I start the mesh it runs fine. Using to the underlying service Apollo Sandbox or the Mesh graphiql UI works for both query and subscription.
I then created a small React web app that connects to the underlying service (port 4100) and subscribes as expected.
However, when pointing to the mesh (port 4200) it fails and shows an error message:
I then built a little NodeJS websockets client, to perhaps see if this has something to do with react.
Directly with the underlying service (port 4100) it works as expected but the same issue occurred with the mesh (port 4200).
Any ideas?
The graphql-mesh code (cli/bin.js::onSusbcribe) that fails seems to not check if the
connectionParams
argument is assigned. But why is it unassigned?Underlying service code:
Mesh definition:
NodeJS WS Client:
Beta Was this translation helpful? Give feedback.
All reactions