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.1.0(2mo ago)05.7k—2.6%1[2 PRs](https://github.com/JimCronqvist/graphql-client/pulls)MITPHPPHP ^7.2|^8.0

Since Jun 2Pushed 3w 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 2d ago

READMEChangelog (4)Dependencies (3)Versions (7)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

52

—

FairBetter than 96% of packages

Maintenance91

Actively maintained with recent releases

Popularity24

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity69

Established project with proven stability

 Bus Factor1

Top contributor holds 85.7% 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 ~836 days

Total

4

Last Release

78d 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 (6 commits)")[![phucsystem](https://avatars.githubusercontent.com/u/3379233?v=4)](https://github.com/phucsystem "phucsystem (1 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.7k9.5M89](/packages/openai-php-laravel)[gmostafa/php-graphql-client

GraphQL client and query builder.

3218.2M29](/packages/gmostafa-php-graphql-client)[tencentcloud/tencentcloud-sdk-php

TencentCloudApi php sdk

3741.3M47](/packages/tencentcloud-tencentcloud-sdk-php)[resend/resend-php

Resend PHP library.

617.2M43](/packages/resend-resend-php)[mozex/anthropic-laravel

Laravel integration for the Anthropic API: facade, config publishing, install command, testing fakes, messages, streaming, tool use, thinking, and batches.

74331.3k1](/packages/mozex-anthropic-laravel)[eslazarev/wildberries-sdk

Wildberries OpenAPI clients (generated).

273.0k](/packages/eslazarev-wildberries-sdk)

PHPackages © 2026

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