GraphiQL.createFetcher does not work for subscriptions-transport-ws
See original GitHub issueAs 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:
window.GraphiQL.createFetcher({url: fetchURL, subscriptionUrl: ${safeSerialize(
subscriptionEndpoint,
)}});
Then I got error as shown in the below screenshot:
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
Issue Analytics
- State:
- Created 3 years ago
- Reactions:1
- Comments:12 (7 by maintainers)
Top Results From Across the Web
How to Use Subscriptions in GraphiQL - Apollo GraphQL Blog
Finally, all you have to do is start your server, open your browser in http://localhost:3000/graphiql, write a GraphQL subscriptions query ...
Read more >@graphiql/create-fetcher - npm package | Snyk
The npm package @graphiql/create-fetcher was scanned for known vulnerabilities and missing license, and no issues were found. Thus the package was deemed as ......
Read more >graphiql - npm
Automatically adds required fields to queries. Documentation explorer, search, with markdown support. Query History using local storage; Run and ...
Read more >graphiql/toolkit - UNPKG
@graphiql/toolkit/docs/create-fetcher.md. Version: ... which act as client reference implementations of the [GraphQL over HTTP Working Group ...
Read more >@graphiql/toolkit | Yarn - Package Manager
This is a general purpose library for building GraphQL IDEs. ... like graphiql and @graphiql/react and also provides utilities that are useful when...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@junminstorage introduced the
legacyClient
option as requested in the above PR, and just made it so that onlygraphql-ws
is tried withsubscriptionsUrl
since the failover logic is too complex and unnecessary, when most projects are instantiating a custom client instance anyways.thanks for all your work @junminstorage getting this working in the ecosystem, hoping to help you get everything working nicely here and in
express-graphql
in the following weeks!@acao make sense. thank you!