Graphql-playground: Server cannot be reached/no visible schema/still able to execute a query

Created on 25 Jul 2018  Â·  7Comments  Â·  Source: graphql/graphql-playground

This issue pertains to the following package(s):

  • [x] graphql
  • [x] graphql-playground
  • [x] graphql-tag

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

  • Windows 10 Pro

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

  • graphql: ^0.13.2
  • graphql-playground: ^1.3.17
  • graphql-tag: ^2.9.2

What is the expected behavior?

I should be able to open GraphQL Playground, select a valid endpoint and see the schema.

What is the actual behavior?

Upon entering URL: http://internal-environment/api/mobile/ as the endpoint and opening the schema tab, the schema is not visible and the endpoint says "Server cannot be reached" at the top of the page.

I can still execute my query and obtain the correct results, however they are quickly replaced with a 401 error.

Changing the endpoint to http://local.environment/api/mobile completely works, i see the schema and receive no 401 error, however I need to gain access to the internal endpoint instead.

What steps may we take to reproduce the behavior?

  1. Open GraphQL Playground desktop
  2. Select the 'URL ENDPOINT' option
  3. Enter a valid endpoint (not local)
  4. Open the 'schema' tab

_Please provide a gif or image of the issue for a quicker response/fix._
I cannot provide images but,
The screen first showed a blank schema and 'server cannot be reached'

the query successfully retrieved the data

the successful response eventually threw a 401 error - sometimes immediately, sometimes after a short amount of time, sometimes after navigating to settings or away from the playground.

Not sure if i am missing a step or some kind of dependency or if this is a bug.
Eagerly awaiting a response and solution.

Most helpful comment

For apollo-server in production mode, you need to enable introspection.

const server = new ApolloServer({
  playground: true,
  introspection: true
})

Is there a way to use the playground with introspection: false.

All 7 comments

Did you find a resolution to this? I am having the same issue.

nope still struggling. ditched graphiql because i couldnt generate a file
variable to be used in a mutation. i just console log the output in
javascript now

On Wed, Sep 26, 2018, 03:04 Logan Garland notifications@github.com wrote:

Did you find a resolution to this? I am having the same issue.

—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
https://github.com/prisma/graphql-playground/issues/800#issuecomment-424421917,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AY_DYtfYFHkyMMKqHV3dkDDTIpYBV2YPks5uemIygaJpZM4Vfg6H
.

The issue for me was that the playground is disabled when in production mode.

For apollo-server in production mode, you need to enable introspection.

const server = new ApolloServer({
  playground: true,
  introspection: true
})

Is there a way to use the playground with introspection: false.

@MattHoldsworth Your url is not working anymore, so its impossible to test it. So i am closing this one. @gutenye No its not possible right now, can you create feature request issue?

if you are using apollo-server you have to add
const apolloServer = new ApolloServer({
playground: true,
introspection: true
...
})

Was this page helpful?
0 / 5 - 0 ratings

Related issues

anodynos picture anodynos  Â·  19Comments

gajus picture gajus  Â·  19Comments

jazzzz picture jazzzz  Â·  38Comments

marktani picture marktani  Â·  13Comments

nicolas-besnard picture nicolas-besnard  Â·  22Comments