Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Laravel Graphql Playground Laravel Package

mll-lab/laravel-graphql-playground

Adds the GraphQL Playground IDE to your Laravel app, giving you an in-browser interface to explore schemas, write queries, and test your GraphQL API. Integrates smoothly with Laravel GraphQL servers such as Lighthouse and is quick to install and configure.

View on GitHub
Deep Wiki
Context7

Getting Started

  • Install with composer require mll-lab/laravel-graphql-playground. Laravel's package auto-discovery registers the service provider — no manual config/app.php edit needed on Laravel 5.5+.
  • You need a GraphQL server running first. This package only ships the frontend IDE, not the GraphQL execution engine. It is designed to sit alongside Lighthouse (nuwave/lighthouse), which serves the /graphql endpoint by default.
  • Publish the config: php artisan vendor:publish --tag=graphql-playground. Open config/graphql-playground.php — this is where the route path, enabled flag, endpoint URL, headers, and Playground settings live.
  • Visit /graphql-playground (the default route) in the browser. You should see the Playground IDE pointing at /graphql.
  • First use case: run queries and mutations against your Lighthouse schema while developing, use the "Schema" and "Docs" tabs to introspect types, and save queries in browser storage between sessions.

Implementation Patterns

  • Local-only dev tool. Gate the route in config/graphql-playground.php with 'enabled' => env('APP_ENV') === 'local' (or app()->environment('local') in a service provider), so the IDE never leaks into staging or production bundles.
  • Point at the right endpoint. Set the endpoint key to your actual GraphQL route — if you renamed Lighthouse's route or mounted it under a prefix (e.g. api/graphql), update this or the IDE will 404 on every request.
  • Auth headers. For token-guarded GraphQL APIs, set default headers in config so you don't paste a Bearer token into the UI on every reload. For session-guarded endpoints, keep request.credentials: 'same-origin' in the Playground settings so cookies ride along.
  • Protect non-local environments. If you must expose it on a shared staging box, wrap the route in middleware — an auth gate or an IP allowlist — because the package ships no authorization by default.
  • Tune the editor via settings. Override things like editor.theme, editor.fontSize, request.credentials, and tracing.hideTracingResponse through the config array; these are passed straight into GraphQLPlayground.init.
  • Schema polling. During active schema work, enable polling (or just reload) so the Docs pane reflects new Lighthouse types without restarting the page.
  • Multi-project setup. Each Laravel app gets its own instance; there is no shared config. Keep per-app endpoints in each app's published config.

Gotchas and Tips

  • This package is archived and deprecated. It is superseded by mll-lab/laravel-graphiql. For any new project, start there — API, config shape, and route semantics are similar, so migration is mostly a composer swap plus config key tweaks.
  • The underlying GraphQL Playground tool is itself deprecated upstream in favor of GraphiQL. Even if the Laravel wrapper weren't archived, you'd be building on an unmaintained frontend.
  • No release since Feb 2022. Do not expect fixes for Laravel 10/11 service-provider or route-loading changes. Verify it works on your framework version before depending on it in a long-lived project.
  • Assets come from a CDN. The IDE loads GraphQL Playground JS/CSS from a remote host, so it won't render offline, behind an air-gapped network, or under a strict Content-Security-Policy. Add the CDN to your CSP or vendor the assets yourself if needed.
  • Config cache bites. After editing config/graphql-playground.php, run php artisan config:clear — a stale cached config will keep the old enabled/endpoint values and produce a confusing 404 or empty schema.
  • Route registration is conditional. The route is only registered when the enabled flag is truthy at boot. Toggling it via .env without clearing the config cache is the most common "why is it 404?" cause.
  • Schema won't load? Check, in order: (1) the endpoint value matches the real GraphQL route, (2) the GraphQL server is actually returning valid introspection JSON (curl the endpoint), and (3) any CORS/session middleware permits the Playground origin.
  • Middleware ordering. If your GraphQL route uses auth/throttle, the Playground UI will render but requests will fail with 401/429. Surface that as a header in the IDE rather than debugging blind.
  • Extension points are thin. There's no plugin system inside the package; customization is limited to the published config array and (if you must) overriding the view. If you need meaningful behavior changes, that's another signal to move to laravel-graphiql.
  • Treat it as a stopgap. If you inherit a codebase using it, plan a migration ticket rather than building tooling around it.
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
robertmarney/lara-hierarchial-collections
simonschaufi/rule-doc-generator
emissaoja/emissaoja
blackbricksoftware/gravityforms-civicrm-form-processor
al-rahabi/fancy-crud
jinas/dhivatar-component
mltstephane/laravel-quality
bernskiold/laravel-talentlms
bernskioldmedia/laravel-form-architect
youbar/easy-crud
c-point-labs/laravel-hostyourai
dbravoan/dbcms-admin-theme-dbcms
dbravoan/dbcms-theme-db-cyber
dbravoan/dbcms-blocks-basic
dbravoan/dbcms-module-content-audit
dbravoan/dbcms-module-ai-assistant
paygate-to/paygate-php
padosoft/askmydocs-connector-base
defstudio/supercharged-carbon
bernskioldmedia/laravel-matomo