graphql / graphql-playground

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

Query not work with introspection set to false #876

Open gutenye opened 5 years ago

gutenye commented 5 years ago

This issue pertains to the following package(s):

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

macOS

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

1.7.4

What is the expected behavior?

Query works with introspection set to false.

What is the actual behavior?

Query works, but last for 3 seconds, after that it shows {"error": "Response not success: Received status code 400"}. The real error from the network panel is {"errors":[{"message":"GraphQL introspection is not allowed by Apollo Server, but the query contained __schema or __type

What steps may we take to reproduce the behavior?

With Apollo-server, enable playground, disable introspection.

new ApolloServer({
  playground: true,
  introspection: false
})

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

playground

yoshiakis commented 5 years ago

It's because an Introspection query continues to be sent until the query was succeeded and the introspection query error response overwrites the display of the previous one.

@Huvik What do you think if graphql playground is changed so that when schema.polling.enable is false, graphql playground not only doesn't poll schema but also doesn't send an introspection query?

yoshiakis commented 5 years ago

Probably I was using a previous version of graphql playground😅 I just checked if the bug still exists using the latest one and I didn't find the bug.