-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
GraphiQL.createFetcher does not work for subscriptions-transport-ws #1800
Comments
@junminstorage thank you for looking into this, this is strange and not how it should behave. |
I also pulled in graphiql/packages/graphiql-toolkit/src/lib.ts Lines 70 to 80 in 3286b9c
|
@junminstorage no changes have been made to address your bug yet. we will probably remove support for the legacy protocol |
I will let you know when there is an update, but for now just letting you know that the location of the package has changed |
I tried out the approach as in this function:
the difference is that, if we add a listener for connected event using legacy client, like below:
The listenerFn function will only be called if it is subscription-transport-ws server. The express-graphql is already on legacy ws client, it will be great if we support it. how hard is to add legacyClient as one of the options in createFetcher? |
express graphql should not be using deprecated packages imo. the legacy protocol is deprecated, so we will remove it in the next release |
https://www.npmjs.com/package/subscriptions-transport-ws still have 1.7 millions weekly download. we have the chance to support both protocols with little cost here. if we remove it from express-graphql, next release will be breaking change. And we also need to make change and fix the bug in this rc as well. anyway, just let me know the direction we eventually take, I can help with this issue as well. |
@junminstorage do you think you could introduce a PR for this fix then? maybe collaborate with @ryan-m-walker and/or @imolorhe since i’m taking a break? |
Surely and happy to do so. Let me draft a PR to start the discussion with them. |
I have a fix coming! |
@junminstorage introduced the thanks for all your work @junminstorage getting this working in the ecosystem, hoping to help you get everything working nicely here and in |
@acao make sense. thank you! |
As shown in this PR on express-graphql: https://github.com/graphql/express-graphql/pull/739/files#diff-f851f2ce2fbcb0220aaca183def93d7ced5b533fead2016551cfd6d37b357ae5, I started the graphql server with subscription using legacy subscriptions-transport-ws.
Then on the client side I create fetcher like this:
Then I got error as shown in the below screenshot:
![Screen Shot 2021-02-10 at 9 29 46 PM](https://user-images.githubusercontent.com/140900/107597200-f2335580-6be7-11eb-9d6b-f045866e1b4d.png)
The same client side code works if I started a graphql server using graphql-ws though:
https://github.com/graphql/express-graphql/pull/739/files#diff-4f5f57981087dfef3de9e960e86656c7a1d1ef9f424fd0a75e32751163a286e1
The text was updated successfully, but these errors were encountered: