PHPackages                             mathsgod/light-graphql - 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. mathsgod/light-graphql

ActiveLibrary[API Development](/categories/api)

mathsgod/light-graphql
======================

Simple graphql server

1.2.1(6mo ago)0581MITPHPPHP ^8.1

Since Mar 14Pushed 5mo ago1 watchersCompare

[ Source](https://github.com/mathsgod/light-graphql)[ Packagist](https://packagist.org/packages/mathsgod/light-graphql)[ RSS](/packages/mathsgod-light-graphql/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (4)Dependencies (6)Versions (5)Used By (1)

Light GraphQL
=============

[](#light-graphql)

Light GraphQL is a lightweight GraphQL server implementation designed for simplicity and ease of use. This project demonstrates how to set up a basic GraphQL server using PHP.

This library is built using several dependencies, including `thecodingmachine/graphqlite`, which provides annotations and tools for creating GraphQL APIs in PHP. Other key dependencies include:

- **league/container**: A lightweight dependency injection container.
- **symfony/cache**: A caching library for optimizing performance.

These libraries work together to provide a robust and flexible foundation for building GraphQL servers.

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

[](#installation)

```
composer require mathsgod/light-graphql

```

### Key Components

[](#key-components)

- **Schema Factory**: The schema is dynamically created using the `SchemaFactory` provided by the `Light\GraphQL\Server`. It allows adding namespaces for controllers.
- **Controllers**: The `Controllers` namespace is used to define resolvers for GraphQL queries.
- **GraphQL Execution**: The `Server::executeQuery` method is used to execute the GraphQL query against the schema. In the provided example, the query `$query` is executed, and the result is converted to an array using `toArray()`.

### Usage Example

[](#usage-example)

```
use Controllers\RootController;
use GraphQL\GraphQL;

require_once __DIR__ . '/vendor/autoload.php';

$server = new \Light\GraphQL\Server();
$server->getSchemaFactory()->addNamespace("Controllers");

print_R($sever->executeQuery($query)->toArray());
```

#### ServerRequestInterface handling

[](#serverrequestinterface-handling)

```
use Controllers\RootController;
use GraphQL\GraphQL;

$server = new \Light\GraphQL\Server();
$server->getSchemaFactory()->addNamespace("Controllers");

$response=$server->handle($request);
```

###  Health Score

36

—

LowBetter than 82% of packages

Maintenance69

Regular maintenance activity

Popularity9

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity49

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

Every ~74 days

Total

4

Last Release

207d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/18732337?v=4)[Raymond](/maintainers/mathsgod)[@mathsgod](https://github.com/mathsgod)

---

Top Contributors

[![mathsgod](https://avatars.githubusercontent.com/u/18732337?v=4)](https://github.com/mathsgod "mathsgod (19 commits)")

### Embed Badge

![Health badge](/badges/mathsgod-light-graphql/health.svg)

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

###  Alternatives

[oxid-esales/graphql-base

OXID eSales GraphQL base module

24101.0k10](/packages/oxid-esales-graphql-base)[thecodingmachine/graphqlite

Write your GraphQL queries in simple to write controllers (using webonyx/graphql-php).

5723.1M30](/packages/thecodingmachine-graphqlite)[thecodingmachine/graphqlite-bundle

A Symfony bundle for thecodingmachine/graphqlite.

371.6M3](/packages/thecodingmachine-graphqlite-bundle)[thecodingmachine/graphqlite-laravel

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

1852.3k1](/packages/thecodingmachine-graphqlite-laravel)[storyblok/php-content-api-client

PHP Client for Storyblok Content API

11136.8k4](/packages/storyblok-php-content-api-client)

PHPackages © 2026

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