Code review at scale is broken. Here’s how Augment Code is fixing it.

Graphql Laravel

rebing/graphql-laravel image

Graphql Laravel stats

Downloads
3M
Stars
2,033
Open Issues
10
Forks
264

View on GitHub →

Laravel wrapper for PHP GraphQL

Laravel GraphQL Package Summary

Laravel GraphQL is a powerful package that integrates Facebook's GraphQL with PHP 8.0+ and Laravel 9.0+. This package is based on the PHP port of the GraphQL reference implementation by webonyx/graphql-php.

Key Features

  • Flexible Queries and Mutations: Easily create GraphQL queries and mutations as endpoints.
  • Support for Multiple Schemas: Configure different schemas with specific queries, mutations, types, and middleware.
  • Custom Resolver Middleware: Define custom middleware for query and mutation resolvers.
  • Eloquent Support: Utilize the SelectFields class for dynamic field retrieval and efficient data loading, addressing the N+1 query problem.
  • Advanced Features:
    • Per-query authorization and field-level visibility.
    • Support for pagination and query batching.
    • Built-in handling for file uploads.

Installation

  1. Dependencies:

    • Laravel 9.0+
    • GraphQL PHP (webonyx/graphql-php)
  2. Composer Installation:

    composer require rebing/graphql-laravel
  3. Publish Configuration:

    php artisan vendor:publish --provider="Rebing\GraphQL\GraphQLServiceProvider"

    Review and configure config/graphql.php as needed.

Usage Highlights

  • Define GraphQL schemas, types, queries, and mutations in your Laravel application.
  • Configure middleware at the schema level for fine-grained control over HTTP requests.
  • Use SelectFields for optimizing database queries and relationships in Eloquent.
  • Leverage advanced features like pagination, file uploads, and custom scalars for enhanced API capabilities.

This package extends the capabilities of Laravel applications by enabling the creation of flexible and efficient GraphQL APIs, offering a rich set of features to manage data interactions seamlessly. For detailed usage and configuration, refer to the official package documentation.

Cube

Laravel Newsletter

Join 40k+ other developers and never miss out on new tips, tutorials, and more.


Rebing Graphql Laravel Related Articles

Laravel 7.12 Released image

Laravel 7.12 Released

Read article
SaaSykit: Laravel SaaS Starter Kit logo

SaaSykit: Laravel SaaS Starter Kit

SaaSykit is a Multi-tenant Laravel SaaS Starter Kit that comes with all features required to run a modern SaaS. Payments, Beautiful Checkout, Admin Panel, User dashboard, Auth, Ready Components, Stats, Blog, Docs and more.

SaaSykit: Laravel SaaS Starter Kit
PhpStorm logo

PhpStorm

The go-to PHP IDE with extensive out-of-the-box support for Laravel and its ecosystem.

PhpStorm
Get expert guidance in a few days with a Laravel code review logo

Get expert guidance in a few days with a Laravel code review

Expert code review! Get clear, practical feedback from two Laravel devs with 10+ years of experience helping teams build better apps.

Get expert guidance in a few days with a Laravel code review
Laravel Cloud logo

Laravel Cloud

Easily create and manage your servers and deploy your Laravel applications in seconds.

Laravel Cloud
Harpoon: Next generation time tracking and invoicing logo

Harpoon: Next generation time tracking and invoicing

The next generation time-tracking and billing software that helps your agency plan and forecast a profitable future.

Harpoon: Next generation time tracking and invoicing
Shift logo

Shift

Running an old Laravel version? Instant, automated Laravel upgrades and code modernization to keep your applications fresh.

Shift