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 1mo 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

27

—

LowBetter than 49% of packages

Maintenance48

Moderate activity, may be stable

Popularity2

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity45

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

384d 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

[kbsali/redmine-api

Redmine API client

4221.1M24](/packages/kbsali-redmine-api)[getbrevo/brevo-php

Official Brevo provided RESTFul API V3 php library

963.1M35](/packages/getbrevo-brevo-php)[swisnl/json-api-client

A PHP package for mapping remote JSON:API resources to Eloquent like models and collections.

211473.2k12](/packages/swisnl-json-api-client)[wordpress/php-ai-client

A provider agnostic PHP AI client SDK to communicate with any generative AI models of various capabilities using a uniform API.

26236.6k14](/packages/wordpress-php-ai-client)[prokerala/astrology-sdk

Prokerala.com Astrology API Client Library for PHP.

2610.0k](/packages/prokerala-astrology-sdk)[luzrain/telegram-bot-api

PHP Wrapper for Telegram Bot API

1032.8k1](/packages/luzrain-telegram-bot-api)

PHPackages © 2026

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