PHPackages                             agence-cyberial/graphql-client - 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. agence-cyberial/graphql-client

ActiveLibrary[API Development](/categories/api)

agence-cyberial/graphql-client
==============================

Graphql Client for Laravel

v1.5.2(4mo ago)01.0kISCPHP

Since Apr 23Pushed 4mo agoCompare

[ Source](https://github.com/Agence-PrestaShop-CYBERIAL/graphql-client)[ Packagist](https://packagist.org/packages/agence-cyberial/graphql-client)[ Docs](https://github.com/Agence-PrestaShop-CYBERIAL/graphql-laravel-client#readme)[ RSS](/packages/agence-cyberial-graphql-client/feed)WikiDiscussions main Synced today

READMEChangelog (4)Dependencies (4)Versions (7)Used By (0)

Minimal GraphQL Laravel Client
==============================

[](#minimal-graphql-laravel-client)

Minimal GraphQL client for Laravel.

Requirements
------------

[](#requirements)

- Composer 2+

Installation
------------

[](#installation)

Install Package (Composer 2+)

```
composer require AgenceCyberial/graphql-client
```

Usage
-----

[](#usage)

Enviroment variable

```
GRAPHQL_ENDPOINT="https://api.spacex.land/graphql/"
```

Authentication
--------------

[](#authentication)

We provide a minimal authentication integration by appending the `Authorization` header to the request client. You can pass the credentials using an `env` variable.

```
GRAPHQL_CREDENTIALS="YOUR_CREDENTIALS"
```

You can also pass auth credentials at runtime using `withToken($credentials)` method.

'Authorization' header and 'Bearer' Schema are used by default. You can override the default behaviour by defining following variables in your `.env` file.

```
GRAPHQL_AUTHENTICATION_HEADER="Authorization"

// Allowed: basic, bearer, custom
GRAPHQL_AUTHENTICATION="bearer"
```

Usage/Examples
--------------

[](#usageexamples)

Import GraphQL Client Facades

```
use AgenceCyberial\GraphqlClient\Facades\GraphQL;
```

#### Basic use

[](#basic-use)

```
return GraphQL::query('
    capsules {
        id
        original_launch
        status
        missions {
            name
            flight
        }
    }
')->get();
//->get('json'); //get response as json object
```

#### Mutator Request

[](#mutator-request)

```
return GraphQL::mutator('
    insert_user(name: "David") {
        id
        name
        date_added
    }
')->get();
//->get('json');
```

You can access "query" or "mutator" as a shortcut if you are not passing variables, if is not the case you must use the "raw" attribute:

```
return GraphQL::raw('
    mutation($name: String) {
        insert_user(name: $name) {
            id
            name
            date_added
        }
    }
')
->with(["name" => "David"])
->get();
//->get('json');
```

The `variables` or `payload` to the GraphQL request can also be passed using magic methods like:

```
return GraphQL::raw('
    mutation($name: String) {
        insert_user(name: $name) {
            id
            name
            date_added
        }
    }
')
->withName("David")
->get();
//->get('json');
```

#### Raw Response

[](#raw-response)

You can get the raw response from the GraphQL request by using `getRaw()` method instead of `get()` in the request.

```
return GraphQL::raw('
    mutation($name: String) {
        insert_user(name: $name) {
            id
            name
            date_added
        }
    }
')
->with(["name" => "David"])
->getRaw();
//->getRaw('json');
```

If you want to address the request to another endpoint, you can do :

```
return GraphQL::endpoint("https://api.spacex.land/graphql/")
->query('
    capsules {
        id
        original_launch
        status
        missions {
            name
            flight
        }
    }
')->get();
//->get('json');
```

Headers
-------

[](#headers)

You can include a header to the request by using the attribute "header" or add multiple headers by "withHeaders":

```
return GraphQL::query($query)
->header('name', 'value')
->withHeaders([
    'name' => 'value',
    'name' => 'value'
])->get();
```

Context
-------

[](#context)

Add additional context to the request

```
return GraphQL::query($query)
->context([
    'ssl' => [
         "verify_peer" => false,
         "verify_peer_name" => false,
    ]
  ])->get();
```

Author
------

[](#author)

- David Gutierrez [@AgenceCyberial](https://www.github.com/AgenceCyberial)

Top Contributors ⭐
------------------

[](#top-contributors-)

- Ehsan Quddusi [@ehsanquddusi](https://github.com/ehsanquddusi)

Contributors
------------

[](#contributors)

- Ryan Mayberry [@kerkness](https://github.com/kerkness)
- Jamie Duong [@chiendv](https://github.com/chiendv)

###  Health Score

40

—

FairBetter than 88% of packages

Maintenance78

Regular maintenance activity

Popularity20

Limited adoption so far

Community12

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

 Bus Factor2

2 contributors hold 50%+ of commits

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~71 days

Total

4

Last Release

120d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/efcdf7616ee27adad28045a841fca5b4575c0854711c317a2d3d7ff786589949?d=identicon)[CrochetFeve0251](/maintainers/CrochetFeve0251)

---

Top Contributors

[![bendeckdavid](https://avatars.githubusercontent.com/u/10557517?v=4)](https://github.com/bendeckdavid "bendeckdavid (22 commits)")[![CrochetFeve0251](https://avatars.githubusercontent.com/u/18537428?v=4)](https://github.com/CrochetFeve0251 "CrochetFeve0251 (15 commits)")[![ehsanquddusi](https://avatars.githubusercontent.com/u/186699?v=4)](https://github.com/ehsanquddusi "ehsanquddusi (8 commits)")[![billythekid](https://avatars.githubusercontent.com/u/330170?v=4)](https://github.com/billythekid "billythekid (4 commits)")[![chiendv](https://avatars.githubusercontent.com/u/468522?v=4)](https://github.com/chiendv "chiendv (3 commits)")[![kerkness](https://avatars.githubusercontent.com/u/95617?v=4)](https://github.com/kerkness "kerkness (3 commits)")

---

Tags

laravelgraphqlGraphql ClientAgenceCyberial

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/agence-cyberial-graphql-client/health.svg)

```
[![Health](https://phpackages.com/badges/agence-cyberial-graphql-client/health.svg)](https://phpackages.com/packages/agence-cyberial-graphql-client)
```

###  Alternatives

[nuwave/lighthouse

A framework for serving GraphQL from Laravel

3.5k10.4M77](/packages/nuwave-lighthouse)[aimeos/aimeos-laravel

Cloud native, API first Laravel eCommerce package with integrated AI for ultra-fast online shops, marketplaces and complex B2B projects

8.6k212.7k2](/packages/aimeos-aimeos-laravel)[mll-lab/laravel-graphiql

Easily integrate GraphiQL into your Laravel project

633.1M6](/packages/mll-lab-laravel-graphiql)[yakovenko/laravel-lighthouse-graphql-multi-schema

A Laravel package that provides multi-schema support for Lighthouse GraphQL.

1544.2k](/packages/yakovenko-laravel-lighthouse-graphql-multi-schema)[thecodingmachine/graphqlite-laravel

A Laravel service provider package to help you get started with GraphQLite in Laravel.

1851.6k1](/packages/thecodingmachine-graphqlite-laravel)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
