PHPackages                             biohzrdmx/liteql-php - 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. biohzrdmx/liteql-php

ActiveLibrary[API Development](/categories/api)

biohzrdmx/liteql-php
====================

Barebones GraphQL client library

1.0.0(1y ago)02MITPHPPHP &gt;=8.1

Since Apr 30Pushed 1y ago1 watchersCompare

[ Source](https://github.com/biohzrdmx/liteql-php)[ Packagist](https://packagist.org/packages/biohzrdmx/liteql-php)[ RSS](/packages/biohzrdmx-liteql-php/feed)WikiDiscussions master Synced 1w ago

READMEChangelog (1)Dependencies (4)Versions (2)Used By (0)

liteql-php
==========

[](#liteql-php)

Barebones GraphQL client library.

With LiteQL you will be able to run GraphQL queries easily, without requiring to create complicate schemas or generating code. You just run a query and get the result or receive an exception.

Also, you get to choose the PSR-17/18 implementation used, so you get a lightweight and flexible alternative.

### Basic usage

[](#basic-usage)

First require `biohzrdmx/liteql-php` with Composer.

Next you need to create a `LiteQL\Client` instance, to do so you must pass two parameters to the constructor:

- `$http_client` - An instance of an implementation of `ClientInterface` (PSR-18)
- `$request_factory` - An instance of an implementation of `RequestFactoryInterface` (PSR-17)

You are free to choose which implementation to use, just pass both instances to the `create` method of `LiteQL\Client` for easy chaining.

Then use the other methods such as `setUri`, `setHeader` to configure the client, leveraging the fluent interface.

Now it's time to build the `Query` itself, to do so you can create it from a string (with the `fromString` method) or from a `.graphql` file (using the `fromFile` method).

Please do note that at this point the fluent interface returns a `Query` instance, so you may add variables with the `setVariable` method if you want.

Finally, call the `execute` method and you should get a `Result` object.

The full flow looks like the following example:

```
use AwesomeSauce\HttpCLient;
use AwesomeSauce\RequestFactory;

use LiteQL\Client;

$http_client = new HttpClient();
$request_factory = new RequestFactory();
$result = Client::create($http_client, $request_factory)
    ->setUri('https://dummy-pokemon-graphql.local')
    ->fromString('query GetPokemon($name: String) {pokemon(name: $name) {id number name } }')
    ->setVariable('name', 'Pikachu')
    ->execute();
```

To load the query from a file:

```
$result = Client::create($http_client, $request_factory)
    ->setUri('https://dummy-pokemon-graphql.local')
    ->fromFile('/path/to/queries/directory/getPokemon.graphql')
    ->setVariable('name', 'Pikachu')
    ->execute();
```

Either way you will get a `Result` object or a `ClientException` will be thrown (if for example you need authentication, or you hit a request limit, etc.).

### Result object

[](#result-object)

The `Result` object has the following methods:

- `getResponse` - Get the raw `ResponseInterface` implementation
- `getStatusCode` - Get the status code (anything &lt;200 or &gt;299 will generate an exception)
- `getData` - Get the parsed data from the response (if the `Content-Type` header is `application/json`, otherwise an exception will be thrown)

Now you can do whatever you want with the returned data, cache it, parse it, display it, etc.

That's it, you need no introspection or schemas or anything else to query a GraphQL server, just prepare your queries and pass some variables.

### Licensing

[](#licensing)

This software is released under the MIT license.

### Credits

[](#credits)

**Lead coder:** biohzrdmx [&lt;github.com/biohzrdmx&gt;](http://github.com/biohzrdmx)

###  Health Score

26

—

LowBetter than 40% of packages

Maintenance42

Moderate activity, may be stable

Popularity2

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity46

Maturing project, gaining track record

 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

Unknown

Total

1

Last Release

474d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/44b968bb45d47a621ce8e81c422ef4c126316a702156a7faf96df75610cc0d45?d=identicon)[biohzrdmx](/maintainers/biohzrdmx)

---

Top Contributors

[![biohzrdmx](https://avatars.githubusercontent.com/u/2053303?v=4)](https://github.com/biohzrdmx "biohzrdmx (1 commits)")

### Embed Badge

![Health badge](/badges/biohzrdmx-liteql-php/health.svg)

```
[![Health](https://phpackages.com/badges/biohzrdmx-liteql-php/health.svg)](https://phpackages.com/packages/biohzrdmx-liteql-php)
```

###  Alternatives

[tempest/framework

The PHP framework that gets out of your way.

2.3k37.6k21](/packages/tempest-framework)[flow-php/flow

PHP ETL - Extract Transform Load - Data processing framework

86337.5k](/packages/flow-php-flow)[getbrevo/brevo-php

Official PHP SDK for the Brevo API.

1004.1M59](/packages/getbrevo-brevo-php)[drupal/core-recommended

Locked core dependencies; require this project INSTEAD OF drupal/core.

6943.5M449](/packages/drupal-core-recommended)[telnyx/telnyx-php

Official Telnyx PHP SDK — APIs for Voice, SMS, MMS, WhatsApp, Fax, SIP Trunking, Wireless IoT, Call Control, and more. Build global communications on Telnyx's private carrier-grade network.

36826.2k2](/packages/telnyx-telnyx-php)[chargebee/chargebee-php

ChargeBee API client implementation for PHP

758.7M10](/packages/chargebee-chargebee-php)

PHPackages © 2026

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