PHPackages                             supliu/laravel-graphql - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [API Development](/categories/api)
4. /
5. supliu/laravel-graphql

ActiveLibrary[API Development](/categories/api)

supliu/laravel-graphql
======================

GraphQL with Laravel Framework

1.0.1(5y ago)342472MITBladeCI failing

Since Aug 4Pushed 2y ago2 watchersCompare

[ Source](https://github.com/supliu/laravel-graphql)[ Packagist](https://packagist.org/packages/supliu/laravel-graphql)[ RSS](/packages/supliu-laravel-graphql/feed)WikiDiscussions master Synced today

READMEChangelogDependencies (3)Versions (3)Used By (0)

 [![](assets/logo.png)](assets/logo.png)

Laravel GraphQL
===============

[](#laravel-graphql)

[![Latest Stable Version](https://camo.githubusercontent.com/840cff7cfe48ed4b8203a4cf074184a2889a59fe986add5b5ed00a5b75a2dd5b/68747470733a2f2f706f7365722e707567782e6f72672f7375706c69752f6c61726176656c2d6772617068716c2f76)](//packagist.org/packages/supliu/laravel-graphql) [![Total Downloads](https://camo.githubusercontent.com/fac745f71c5b9ba2c230c907e5711fa6dd081efd6511d16ae7b5c3f00320015e/68747470733a2f2f706f7365722e707567782e6f72672f7375706c69752f6c61726176656c2d6772617068716c2f646f776e6c6f616473)](//packagist.org/packages/supliu/laravel-graphql) [![Latest Unstable Version](https://camo.githubusercontent.com/51d592d30edf6504d505be3795d2c781bebab37ade031a62f69f50eb988fe089/68747470733a2f2f706f7365722e707567782e6f72672f7375706c69752f6c61726176656c2d6772617068716c2f762f756e737461626c65)](//packagist.org/packages/supliu/laravel-graphql) [![License](https://camo.githubusercontent.com/d87b38b8a624ef2a13286c4279edf73d31b0965f4b697fa071830f52b770ad9e/68747470733a2f2f706f7365722e707567782e6f72672f7375706c69752f6c61726176656c2d6772617068716c2f6c6963656e7365)](//packagist.org/packages/phpunit/phpunit)

The objective of this project is to facilitate the integration of the [webonyx/graphql-php](https://github.com/webonyx/graphql-php) with the Laravel Framework

 [![](assets/graphiql.png)](assets/graphiql.png)

How to install
--------------

[](#how-to-install)

Use composer to install this package

```
composer require supliu/laravel-graphql

```

Execute a publish with artisan command:

```
php artisan vendor:publish --provider="Supliu\LaravelGraphQL\ServiceProvider"

```

How to use
----------

[](#how-to-use)

You must create your [Query](https://graphql.org/learn/queries/) and [Mutation](https://graphql.org/learn/queries/#mutations) classes and register on `config/graphql.php` so that GraphQL can read.

```
'queries' => [
    'detailHero' => \App\GraphQL\Queries\DetailHero::class
],

'mutations' => [
    'updateHero' => \App\GraphQL\Mutations\UpdateHero::class
]
```

### Query

[](#query)

Below is an example of a Query class that returns the data of a Star Wars hero:

```
