GraphQL Playground
Prism ships with a built-in GraphQL playground — an interactive browser UI where you can write queries, explore your schema, and test mutations in real time.Quick Setup
1
Define your schema
Create your
PrismGraphQLSchema with query and mutation types.2
Add the middleware
Mount
PrismGraphQLMiddleware on your server.3
Add the playground
Mount
PrismGraphQLPlayground for the interactive UI.4
Open in browser
Navigate to
http://localhost:8080/graphql/playground.Complete Setup
How It Works
The playground provides:- Query editor with syntax highlighting
- Variables panel for parameterized queries
- Response viewer with formatted JSON
- Keyboard shortcut — Cmd+Enter (or Ctrl+Enter) to execute
Passing Context
Pass application context (like a database connection) to your resolvers via the middleware:Context Setup
API Endpoints
The middleware handles both GET and POST requests:- POST (recommended)
- GET
Introspection
The playground uses introspection to discover your schema. Try this query to see all available types:Schema Introspection
Production Considerations
Conditional Playground
What’s Next
Schema
Define more complex schemas with nested types
MCP Server
Build AI tool servers with MCP