PHPackages                             xpromx/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. xpromx/laravel-graphql

ActiveLibrary

xpromx/laravel-graphql
======================

Laravel wrapper for Facebook's GraphQL

564[1 PRs](https://github.com/xpromx/laravel-graphql/pulls)PHP

Since Nov 7Pushed 3y ago2 watchersCompare

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

READMEChangelogDependenciesVersions (2)Used By (0)

This project is based of Folklore\\GraphQL package, adding Helpers that make more easy the integration with Laravel.

For more details check:

- Getting Started

    - [Installation](#installation)
    - [GraphiQL](#graphiql)
    - [Types](#types)
    - [Queries](#queries)
    - [Query Arguments](#query-arguments)
- Custom Types

    - [ConnectionType](#connectiontype)
    - [DateType](#datetype)
    - [TimeType](#timetype)
    - [HasManyType](#hasmanytype)
    - [HasOneType](#hasonetype)
    - [MetaType](#metatype)
    - [PageInfoType](#pageinfotype)
- Custom Fields

    - [DateField](#datefield)
    - [TimeField](#timefield)

Installation
============

[](#installation)

1) Composer
-----------

[](#1-composer)

```
composer require xpromx/laravel-graphql

```

2) Create Config File
---------------------

[](#2-create-config-file)

in **/config/graphql.php** check the example inside this repository.

3) Edit bootstrap/app.php
-------------------------

[](#3-edit-bootstrapappphp)

uncomment the follow lines:

```
$app->withFacades();
$app->withEloquent();

$app->register(App\Providers\AppServiceProvider::class);
$app->register(App\Providers\AuthServiceProvider::class);
```

then add this lines in the same file

```
$app->configure('graphql');
$app->register(Folklore\GraphQL\LumenServiceProvider::class);
```

4) Create the GraphQL folder
----------------------------

[](#4-create-the-graphql-folder)

inside this folder: **/app/GraphQL** with these other folders inside: **/Types** and **/Query**

Graphiql
========

[](#graphiql)

An in-browser IDE for exploring GraphQL.

```
http://project-name.test/graphiql

```

Types
=====

[](#types)

Creating new Types = Your Laravel Models check the examples in **/Examples/Type** folder inside this repository. check the custom types section in this doc.

Register the Types in your **/config/graphql.php**.

```
