question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

GraphQL Playground Server Cannot Be Reached Running Locally

See original GitHub issue

This issue pertains to the following package(s):

  • GraphQL Playground

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

Windows 10

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

2.16.7

What is the expected behavior?

Following How to GraphQL Node tutorial and on Connecting Server and Database with Prisma Bindings.

On step “Accessing both GraphQL APIs inside the same Playground”. After running node src/index.js in hackernews-node folder to start and opening separate terminal for graphql playground anticipating being able to work with both GraphQL APIs side-by-side.

What is the actual behavior?

Playground opens up and can access database GraphQL API but app GraphQL API says “Server cannot be reached” and “error”: “Failed to fetch schema. Please check your connection” Terminal has no errors and says I’m running locally on 4000 for app and playground on localhost 3000/playground.

What steps may we take to reproduce the behavior?

Run node project locally and then GraphQL playground. I’ve uploaded my current code to my repositories under GraphQL-Node.

Please provide a gif or image of the issue for a quicker response/fix. graphql-serverissue

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:17
  • Comments:45 (2 by maintainers)

github_iconTop GitHub Comments

34reactions
baninaveencommented, Nov 1, 2018

I am getting same issue

23reactions
DarkEye123commented, Jan 23, 2019

@joanprimpratrec2 thank you! almost same for me

for newcomers -> check your server.start() method and add playground into that.

in my case process.env.PLAYGROUND_URL === "http://localhost:3000"

server.start(
  {
    cors: { credentials: true, origin: [process.env.FRONTEND_URL, process.env.BACKED_URL, process.env.PLAYGROUND_URL] },
  }, ....
);
Read more comments on GitHub >

github_iconTop Results From Across the Web

Apollo Server Express - Playground cannot be reached
I get to the playground on "http://localhost:4000/graphql" but somehow I get the "Server cannot be reached" error. In the network inspector I ...
Read more >
GraphQL Playground - Apollo GraphQL Docs
Apollo Server 2's GraphQL playground feature has an end-of-life date of 31 December 2022. ... The Apollo Studio Explorer now supports local development....
Read more >
Enabling graphql queries in production (Error
I have an issue with configuring graphql queries in production. ... Enabling graphql queries in production (Error: Server cannot be reached).
Read more >
Running an Express GraphQL Server
The simplest way to run a GraphQL API server is to use Express, a popular web application framework for Node.js. You will need...
Read more >
Deploy a GraphQL API as an Azure Function
This sample demonstrates using the Apollo server in an Azure ... Access the GraphQL playground from the locally running Function app.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found