Graphql-playground: Server cannot be reached on electron desktop app

Created on 8 Jun 2018  路  4Comments  路  Source: graphql/graphql-playground

This issue pertains to the following package(s):

  • [x] GraphQL Playground - Electron App
  • [ ] GraphQL Playground HTML
  • [ ] GraphQL Playground
  • [ ] GraphQL Playground Express Middleware
  • [ ] GraphQL Playground Hapi Middleware
  • [ ] GraphQL Playground Koa Middleware
  • [ ] GraphQL Playground Lambda Middleware

What OS and OS version are you experiencing the issue(s) on?

OSX El Capitan
Version 10.11.6

What version of graphql-playground(-electron/-middleware) are you experiencing the issue(s) on?

1.6.0

What is the expected behavior?

That I would be able to connect to a remote server via the electron desktop app. For example, https://portal.ehri-project.eu/api/graphql

What is the actual behavior?

The "Server cannot be reached" message always displays in the desktop app. When I share to the browser, that works. When I test via curl, that also works - but I do have to set the Origin header to an empty string.

What steps may we take to reproduce the behavior?

  1. Create a new workspace via "URL Endpoint", using https://portal.ehri-project.eu/api/graphql as the URL
  2. Copy the following query:
{
  Country(id: "us") {
    name
    situation
  }
}
  1. Update HTTP Headers to:
{
  "Origin":""
}
  1. The address bar should render "Server cannot be reached"

To verify that this should work, you can share to browser (https://graphqlbin.com/v2/7LmgUV) and see that it works, or you can "Copy Curl" and run the following command to see it work:

curl 'https://portal.ehri-project.eu/api/graphql' -H 'Accept-Encoding: gzip, deflate, br' -H 'Content-Type: application/json' -H 'Accept: application/json' -H 'Connection: keep-alive' -H 'DNT: 1' -H 'Origin: ' --data-binary '{"query":"{\n  Country(id: \"us\") {\n    name\n    situation\n  }\n}\n    "}' --compressed

_Please provide a gif or image of the issue for a quicker response/fix._

graphql-playground-bug

Expected response:

{
  "data": {
    "Country": {
      "name": "United States",
      "situation": "The basic archival structure of the United States is provided by the National Archives and Records Administration (NARA), which were created in 1934 and became an independent government agency in 1985. In addition to the national archives, there are many private archive initiatives in the United States."
    }
  }
}
bu2-confirmed kinbug

Most helpful comment

I am also getting the same problem, I have reverted to the web app at the moment.

Is there an available workaround until it gets fixed ?

Thanks

All 4 comments

I am also getting the same problem, I have reverted to the web app at the moment.

Is there an available workaround until it gets fixed ?

Thanks

This seems to be fixed in the latest version :-) There are other issues though, not being able to click SHARE, although I notice other bugs are open for this.

@miketmoore I was testing this in the playground and your server returns 403 for introspection query. So maybe you have some bad setting for your server.

@appsolutegeek I tested in Version 1.8.0 (1.8.0.4820) and this is still a problem. The curl request works, the web version works, but the Electron app does not work.

Was this page helpful?
0 / 5 - 0 ratings