graphql / graphql-playground

🎮 GraphQL IDE for better development workflows (GraphQL Subscriptions, interactive docs & collaboration)
MIT License
8.76k stars 734 forks source link

Server cannot be reached/no visible schema/still able to execute a query #800

Closed MattHoldsworth closed 5 years ago

MattHoldsworth commented 6 years ago

This issue pertains to the following package(s):

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

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

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.

legarland commented 6 years ago

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

MattHoldsworth commented 6 years ago

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 .

legarland commented 6 years ago

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

gutenye commented 5 years ago

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.

huv1k commented 5 years ago

@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?

gutenye commented 5 years ago

Created in https://github.com/prisma/graphql-playground/issues/876

Wil-Quispe commented 3 years ago

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