⬡ GraphQL Beginner

What is the GraphQL Playground and introspection?

Answer

GraphQL Playground (and its successor GraphiQL) is an interactive browser-based IDE for exploring and testing GraphQL APIs. It provides auto-complete, syntax highlighting, schema documentation, and query history. It works because of introspection — a built-in GraphQL feature that lets clients query the schema itself. For example: { __schema { types { name } } } returns all types defined in the API. Introspection is powerful for tooling but should be disabled in production to prevent exposing your schema to potential attackers who could use it to craft targeted queries.