A Laravel wrapper for Facebook's GraphQL that provides a code-first integration using PHP classes.
Laravel GraphQL is a Laravel package that provides a code-first integration of GraphQL into Laravel applications. It allows developers to build GraphQL APIs by defining types, queries, and mutations in PHP classes, leveraging Laravel's ecosystem for validation, authorization, and data handling. The package solves the problem of implementing GraphQL in Laravel without needing separate GraphQL schema definition files.
Laravel developers building GraphQL APIs who prefer a code-first approach and want tight integration with Laravel's features like Eloquent, validation, and middleware.
Developers choose Laravel GraphQL because it provides a native Laravel experience with GraphQL, offering code-first schema definition, built-in support for Laravel validation and authorization, multiple data loading strategies to prevent n+1 queries, and extensive middleware support—all while maintaining compatibility with Laravel conventions.
Laravel wrapper for Facebook's GraphQL
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Tightly integrates with Laravel's validation, authorization, and middleware systems, allowing developers to use familiar Laravel conventions without context switching.
Offers two strategies—Dataloaders for deferred batching across any data source and SelectFields for Eloquent-specific eager loading—to effectively prevent n+1 query issues.
Define GraphQL types, queries, and mutations entirely in PHP classes, providing better IDE support, type safety, and eliminating the need for separate .graphql files.
Includes built-in security measures like introspection control, query depth limiting, complexity analysis, and batching limits, making it production-ready out of the box.
The package explicitly does not support GraphQL subscriptions; for real-time functionality, developers must rely on external solutions like Lighthouse or custom WebSocket implementations.
The SelectFields feature for Eloquent eager loading has known limitations with complex relations or abstract types, which can complicate optimization for advanced database queries.
Tightly coupled with specific Laravel versions (12.x - 13.x), which may hinder upgrades or compatibility with older or newer Laravel releases outside this range.