Skip to content

GraphiQL.createFetcher does not work for subscriptions-transport-ws #1800

@junminstorage

Description

@junminstorage

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:

window.GraphiQL.createFetcher({url: fetchURL, subscriptionUrl: ${safeSerialize(
            subscriptionEndpoint,
          )}});

Then I got error as shown in the below screenshot:
Screen Shot 2021-02-10 at 9 29 46 PM

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions