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

ActiveLibrary[API Development](/categories/api)

cronqvist/graphql-client
========================

A GraphQL client for executing queries and mutations

1.0.2(2mo ago)04.6k↓34.6%[2 PRs](https://github.com/JimCronqvist/graphql-client/pulls)MITPHPPHP ^7.2|^8.0

Since Jun 2Pushed 2mo ago1 watchersCompare

[ Source](https://github.com/JimCronqvist/graphql-client)[ Packagist](https://packagist.org/packages/cronqvist/graphql-client)[ RSS](/packages/cronqvist-graphql-client/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (3)Dependencies (2)Versions (6)Used By (0)

GraphQL Client
==============

[](#graphql-client)

A simple PHP library to interact with GraphQL APIs.

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

[](#installation)

Run the following command to install the package using composer:

`composer require cronqvist/graphql-client`

Usage
-----

[](#usage)

Create an instance of `Jc\GraphQL\GraphQLClient`:

```
$client = new GraphQLClient($url);
$client->setAuthToken('xxx');

// Define the query or queries
$query = data();

// If you only send one query, you can get access to it directly:
$user = $response->firstData();

// You can also access the data directly (user) via the getter
$user = $response->user;

// Fetch can be used with three arguments where variables and headers are optional
$response = $client->fetch($query, $variables, $headers);

```

Error handling:

```
// Easiest is to use the 'throwFirstError' method to throw an exception if any GraphQL error was returned:
$response->throwFirstError();

// or...

// Check if any errors exist
if($response->hasErrors()) {

    // Dump all errors
    var_dump($response->errors());

    // Or dump only the first error
    var_dump($response->firstError();
}

```

###  Health Score

50

—

FairBetter than 96% of packages

Maintenance85

Actively maintained with recent releases

Popularity23

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity68

Established project with proven stability

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

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 ~1233 days

Total

3

Last Release

76d ago

PHP version history (3 changes)1.0.0PHP ^7.0

1.0.1PHP ^7.2

1.0.2PHP ^7.2|^8.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/82475ffd53f25a9c36c9da95c2f65981146b1a5ff84a00b02a7537db32927c24?d=identicon)[JimCronqvist](/maintainers/JimCronqvist)

---

Top Contributors

[![JimCronqvist](https://avatars.githubusercontent.com/u/4972970?v=4)](https://github.com/JimCronqvist "JimCronqvist (3 commits)")

---

Tags

phpclientgraphql

### Embed Badge

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

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

###  Alternatives

[openai-php/laravel

OpenAI PHP for Laravel is a supercharged PHP API client that allows you to interact with the Open AI API

3.7k7.6M74](/packages/openai-php-laravel)[gmostafa/php-graphql-client

GraphQL client and query builder.

3217.6M25](/packages/gmostafa-php-graphql-client)[resend/resend-php

Resend PHP library.

564.7M21](/packages/resend-resend-php)[mozex/anthropic-laravel

Anthropic PHP for Laravel is a supercharged PHP API client that allows you to interact with the Anthropic API

71226.4k1](/packages/mozex-anthropic-laravel)

PHPackages © 2026

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