OlegIlyenko / graphiql-workspace

A graphical interactive in-browser GraphQL IDE enhanced with tabbed navigation, HTTP headers, arbitrary endpoints, etc.

Home Page:http://toolbox.sangria-graphql.org/graphiql

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

observer is not defined

kachkaev opened this issue · comments

Hi Oleg,

Looks like the subscriptions are not working in the latest version. GraphiQLSubscriptionsFetcher.js refers to a variable called observer, but it is not defined. Getting an exception when trying to subscribe to something.

screenshot from 2017-11-03 16-52-54


I'm also wondering if sending subscriptions could be disabled when the ws url is not defined. I forgot to define it today and sent a subscription, but this resulted an odd error, because the query was sent to the HTTP server:

screenshot from 2017-11-03 16-54-30

Apollo tried resolving a subscription when there's no event, so the payload was undefined.

Yep @OlegIlyenko broke it with this commit: 6258979
The dependency on subscription-transport-ws should target 0.8.x, they have deprecated the API the fetcher is using in 0.9.x

I will submit a PR shortly to fix this.

Just published v1.1.4 Sorry for breaking the deps 😰 Thanks again got fixing it, @tlvenn!

Thanks Oleg! Updating to 1.4.4 worked for me in my create-react-app instance, although I had to switch to yarn in order to avoid a duplicate graphql dependency (versions 0.11.* and 0.10.*). @tlvenn many thanks for introducing the "resolutions" section in package.json – otherwise I'd fiddle with duplicate deps forever 😃