-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
GraphQL replication: WebSocket client headers support #4113
Comments
Yes sounds good. You can make a PR if you need this. |
@nirvdrum are you using native hasura queries/mutation/subscription/streams to implement the replication or do you have a remote schema integrated that handled the logic? |
@L-U-C-K-Y I'm using a pretty stock Hasura configuration. No remote schemas, just the generated GraphQL API for my Postgres database. |
@nirvdrum Any luck with this?, I have the same issue. |
Unfortunately, no. I just removed subscriptions for the time being. I think I'm going to go back to managing the WebSocket and replication state manually. |
As part of my RxDB 11 -> 13 upgrade, I've tried to move away from the old style of GraphQL subscriptions via custom WebSockets to RxDB's built-in support. I was confused by why the headers were passed to the
streamQueryBuilder
at first and thought maybe that was just a way to pass state through the system. But, it looks like RxDB is expecting the headers to be part of the GraphQL subscription query. Unfortunately, that's not how all GraphQL servers work.In my case, I'm using Hasura. It expects the header to be a true HTTP header and to the best of my knowledge, there's no option to pass the token as part of the subscription itself. Instead, the header should be passed as part of the
createClient
call. My old code for doing so looks like:Obviously, we wouldn't need any of the Auth0 stuff. RxDB already has the headers in
mutableClientState.headers
. I think it just needs an option to pass the header through ingetGraphQLWebSocket
.The text was updated successfully, but these errors were encountered: