Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Server works locally but not on Heroku after following all given steps #1718

Closed
kala-goyal opened this issue Sep 25, 2018 · 6 comments
Closed
Labels
🌹 has-reproduction ❤ Has a reproduction in Glitch, CodeSandbox or Git repository.

Comments

@kala-goyal
Copy link

Intended Outcome:

I made a server using GraphQL and Apollo that works locally, and would expect that when I add the needed changes (a Procfile, Environment variables, etc), and try to deploy it to Heroku, it would work.

Actual Outcome:

The server code works locally, for example, on localhost:4000, but when on Heroku, it deploys successfully but then the GraphQL Playground says that the Server cannot be reached, and in the right hand, results side of the page, it shows "error": "Failed to fetch schema. Please check your connection"

How to Reproduce the Issue:

You can see the problem here- http://vr-test-server.herokuapp.com/
If you want to pull the code itself, for local and for production, the repository can be cloned by
git clone https://github.com/Naman-Goyal/VRUncannyValleyServer.git

The project can be built by running npm install, and run by npm start

The local version of the server is on the "Local" branch
The production version of the server that is set up to push to heroku is on the "Production" branch

@ghost ghost added the 🌹 has-reproduction ❤ Has a reproduction in Glitch, CodeSandbox or Git repository. label Sep 25, 2018
@bs1180
Copy link

bs1180 commented Sep 25, 2018

By default, both the playground and introspection queries are disabled in production. You've manually enabled the playground but not the introspection query, which results in the error you see, but your API is working fine already. You can actually make queries in the playground if you ignore the error:

image

The solution will be to add introspection: true to your config.

@kala-goyal
Copy link
Author

Thank you so much! It's working now.

@Sakthivelgovindan
Copy link

It's really working.

@surajkrishan
Copy link

surajkrishan commented Mar 29, 2021

i tried passing both values to true i.e
{
playground : true,
introspection: true
}
not working for me :(

@sarthakagsa
Copy link

I did the same as @surajkrishan But still it is not working

@glasser
Copy link
Member

glasser commented Aug 23, 2021

Note that Apollo Server 3 does not have a top-level playground option and has a different landing page as the default. See https://www.apollographql.com/docs/apollo-server/api/plugin/landing-pages/ for details.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 20, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
🌹 has-reproduction ❤ Has a reproduction in Glitch, CodeSandbox or Git repository.
Projects
None yet
Development

No branches or pull requests

6 participants