Skip to content

Getting Started

Requirements

  • PHP ^8.4
  • Laravel 11, 12 or 13

Installation

composer require hmennen90/laravel-graphql

The service provider is auto-discovered. Publish the config and a starter schema:

php artisan vendor:publish --tag=graphql-config
php artisan vendor:publish --tag=graphql-schema

By default the endpoint is served at POST /graphql, with GraphiQL at /graphiql.

Your first query

{
  hello
}
{ "data": { "hello": "world" } }

See Schema (code-first) and Schema (SDL) for how to define your own types, then Laravel Integration for the endpoint, authorization and validation.