Search by

nielsjanssen / laravel-discovery-graphql

NielsJanssen

Rebing GraphQL integration for laravel-discovery

Package info

github.com/NielsJanssen/laravel-discovery-graphql

pkg:composer/nielsjanssen/laravel-discovery-graphql

Statistics

Installs: 7

Dependents: 0

Suggesters: 0

Stars: 0

Open Issues: 0

v1.0.0-rc.2 2026-09-12 15:14 UTC

README

Note

This is a read-only split mirror of the laravel-discovery monorepo. Please open issues and pull requests there.

laravel-discovery-graphql

Register Rebing GraphQL queries and mutations from attributes. A method carrying #[Query] or #[Mutation] becomes a field in your schema, with its arguments taken from the method signature.

use NielsJanssen\Laravel\Discovery\RebingGraphQL\Arg;
use NielsJanssen\Laravel\Discovery\RebingGraphQL\Authorize;
use NielsJanssen\Laravel\Discovery\RebingGraphQL\Query;

class Inventory
{
    #[Query(type: 'Product')]
    public function product(#[Arg('id')] #[Authorize('view')] Product $product): Product
    {
        return $product;
    }
}

The id argument resolves to the model, the view policy runs before the resolver, and the field appears in your schema as product(id: ID!): Product!.

Requirements

  • PHP 8.5+
  • Laravel 13+
  • rebing/graphql-laravel ^10.0
  • nielsjanssen/laravel-discovery ^1.0

Installation

composer require nielsjanssen/laravel-discovery-graphql

The service provider registers itself through Laravel's package discovery.

Documentation