Replies: 2 comments
-
@omarzouk How did you solve this? |
Beta Was this translation helpful? Give feedback.
0 replies
-
Hi, for custom subscription URL you can use |
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
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi! Let me start by saying that this is an amazing project! thank you so much for all the work you have done!
We have a GraphQL server that we would like to stitch with other services. This server however, is running the query and the subscription services on two different endpoint urls,
/
and/websocket
. We also want to pass in an Authorization url parameter to the/websocket
which comes from a header that is passed in by the user.So ideally it would be like this
query:
https://api.soundtrackyourbrand.com/v2/
and subscription:
wss://api.soundtrackyourbrand.com/v2/websocket?Authorization=Bearer%20xxxx
So basically the resolver needs to use a different url for the subscription path. I tried creating 2 sources, 1 for query and 1 for subscription in the meshrc yaml and stitching them, but the problem is that when providing the
/websocket
url, the serve is unable to fetch the schema from that url.What is the best way I can achieve this?
I have been thinking about using a custom websocketImpl and that would solve the url issue, but won't allow me to pass in the authorization parameter because the headers are not forwarded to the websocketImpl, so I can't add it as an argument for the url.
The other path I'm thinking of now, is to use 2 sources, and in the subscription source, provide the
/websocket
url, and define a custom fetch function to trim the url and get the schema from the/
endpoint.Any pointers or ideas would be really appreciated!
Beta Was this translation helpful? Give feedback.
All reactions