nuwave/lighthouse
Lighthouse is a Laravel-first GraphQL server framework. Define schemas, resolve data with Eloquent, and handle common GraphQL tasks with built-in directives and extensibility. Docs at lighthouse-php.com. Note: repo planned to move to spawnia/lighthouse.
.graphql files) while maintaining Laravel’s Eloquent ORM and service container. This avoids reinventing the wheel for GraphQL resolvers, reducing boilerplate and improving maintainability.@query, @mutation, @relation) maps cleanly to Laravel’s conventions (e.g., Eloquent models, relationships). This reduces cognitive load for backend developers familiar with Laravel.@auth, @can, @paginate) allow incremental adoption. Teams can start with core CRUD and layer on features (e.g., subscriptions, federation) as needed.@auth directive uses Laravel’s Auth facade).MocksResolvers).@query on a model auto-generates a resolver)._lighthouse_ide_helper.php for autocompletion in PHPStorm/PhpStorm.ASTCache).@lazyLoad directive defers expensive queries until needed.@paginate with complexityResolver).@query) are intuitive, advanced features (e.g., @federation, @bind, @hasOneThrough) may require deeper GraphQL knowledge.ReportingErrorHandler).@hide in favor of @feature).graphql-php and webonyx/graphql-php, which may introduce version conflicts.@depthLimit directive.)reports.proto, BuildExtensionsResponse) sufficient, or do we need custom logging?@throttle directive) and authz (e.g., @can) at scale?ReportingErrorHandler) adequate for our error disclosure policy?spawnia/lighthouse? (E.g., dependency updates, CI/CD adjustments.)@middleware directive)..graphql files are version-controlled alongside Laravel code (unlike code-first approaches).@key, @extends).Phase 1: Proof of Concept (PoC)
composer require nuwave/lighthouse).User.graphql with @query, @mutation).Phase 2: Incremental Rollout
@query for lists).@can).@paginate) and lazy loading (@lazyLoad).Phase 3: Full Adoption
@subscription for notifications).@key, @entity, @extends.@mutation for orders).composer.json constraints).How can I help you explore Laravel packages today?