PHPackages                             axtiva/flexible-graphql-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. axtiva/flexible-graphql-php

ActiveLibrary[API Development](/categories/api)

axtiva/flexible-graphql-php
===========================

Schema SDL first lib for generate php code from graphql sdl to TypeRegistry with webonyx/graphql-php

v3.0.1(2mo ago)1426.3k—0%1[1 PRs](https://github.com/axtiva/flexible-graphql-php/pulls)2MITPHPPHP ^8.3CI passing

Since Oct 16Pushed 2mo ago2 watchersCompare

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

READMEChangelog (10)Dependencies (9)Versions (38)Used By (2)

Axtiva Flexible Graphql
=======================

[](#axtiva-flexible-graphql)

Schema first lib for generate php code from graphql sdl to TypeRegistry whom support [webonyx/graphql-php](https://github.com/webonyx/graphql-php) with simple integrate to any controller.

TL;DR
-----

[](#tldr)

Can easy to integrate graphql to any project, all you need is controller. Fast start with [example](./example/TEST.md)

Features:
---------

[](#features)

- Schema/SDL first code generation (look at [example dir](./example/generate_code.php))
- Support all features from [webonyx/graphql-php](https://github.com/webonyx/graphql-php)
- Executable directives
- Apollo Federation/Federation2 support
- Popular framework integration:
    - Symfony [axtiva/flexible-graphql-bundle](//github.com/axtiva/flexible-graphql-bundle)

Setup
=====

[](#setup)

Composer install:

```
composer require axtiva/flexible-graphql-php

```

Examples:
---------

[](#examples)

- Generate models by types in Graphql Schema [example/generate\_type\_models.php](./example/generate_type_models.php)
- Generate custom scalar resolver by Graphql Schema [example/generate\_scalar\_resolver.php](./example/generate_scalar_resolver.php)
- Generate directive resolver by Graphql Schema [example/generate\_directive\_resolver.php](./example/generate_directive_resolver.php)
- Generate type field resolver by Graphql Schema [example/generate\_field\_resolver.php](./example/generate_field_resolver.php)
- Create lazy loaded TypeRegistry [example/generate\_type\_registry.php](./example/generate_type_registry.php)
- Setup graphql request handler with lazy loaded TypeRegistry [example/start\_graphql\_server.php](./example/start_graphql_server.php)

Demo
----

[](#demo)

Up Dev server for test http Graphql requests:

```
php -S localhost:8080 example/start_graphql_server.php
```

### Change [schema](example/schema.graphql) and run example commands

[](#change-schema-and-run-example-commands)

Update TypeRegistry and model classes from schema and resolvers map:

```
php example/generate_code.php
```

If you need to make field resolver, then remove AutoGenerationInterface from model [CodedCurrencyType](example/GraphQL/Model/CodedCurrencyType.php)

Example:

```
- final class CodedCurrencyType implements AutoGenerationInterface, NodeInterface, CurrencyInterface
+ final class CodedCurrencyType implements NodeInterface, CurrencyInterface
{
    public string $id;
-   public int $code;
}
```

and run `php example/generate_code.php`, after this you will find in [example/Resolver/CodedCurrency/CodeResolver.php](example/Resolver/CodedCurrency/CodeResolver.php). this is your field resolver, define him in your psr container like PsrContainerExample in [example/start\_graphql\_server.php](example/start_graphql_server.php):

```
$container = new PsrContainerExample([
    \Axtiva\FlexibleGraphql\Example\GraphQL\Resolver\Query\AccountResolver::class =>
        new \Axtiva\FlexibleGraphql\Example\GraphQL\Resolver\Query\AccountResolver,
+   \Axtiva\FlexibleGraphql\Example\GraphQL\Resolver\CodedCurrency\CodeResolver::class =>
+       new \Axtiva\FlexibleGraphql\Example\GraphQL\Resolver\CodedCurrency\CodeResolver,
]);
```

Run demo app `php -S localhost:8080 example/start_graphql_server.php` and try request CodedCurrency.code field in query

Tests
-----

[](#tests)

Run tests

```
php vendor/bin/phpunit

```

PHPStan
-------

[](#phpstan)

Run PHPStan

```
php vendor/bin/phpstan analyse -c phpstan.neon

```

###  Health Score

57

—

FairBetter than 98% of packages

Maintenance86

Actively maintained with recent releases

Popularity35

Limited adoption so far

Community14

Small or concentrated contributor base

Maturity77

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

Recently: every ~200 days

Total

27

Last Release

66d ago

Major Versions

v0.2.3 → v1.0.02022-03-26

v1.1.3 → v2.0.0-alpha2023-03-19

v2.2.0 → v3.0.02026-03-13

PHP version history (3 changes)v0.1.0PHP &gt;=7.4

v1.0.0PHP ^7.4 | ^8.0

v3.0.0PHP ^8.3

### Community

Maintainers

![](https://www.gravatar.com/avatar/7b0b7dd34ef515c8cc41feb109b3bd8f67a2e3280f92641dfcba976bdc8b9634?d=identicon)[bpteam](/maintainers/bpteam)

---

Top Contributors

[![bpteam](https://avatars.githubusercontent.com/u/1714419?v=4)](https://github.com/bpteam "bpteam (48 commits)")

---

Tags

apollo-federationapollo-federation-subgrapghcode-generationgraphqlgraphql-serverphpsdl

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Type Coverage Yes

### Embed Badge

![Health badge](/badges/axtiva-flexible-graphql-php/health.svg)

```
[![Health](https://phpackages.com/badges/axtiva-flexible-graphql-php/health.svg)](https://phpackages.com/packages/axtiva-flexible-graphql-php)
```

###  Alternatives

[knuckleswtf/scribe

Generate API documentation for humans from your Laravel codebase.✍

2.3k12.2M45](/packages/knuckleswtf-scribe)[dedoc/scramble

Automatic generation of API documentation for Laravel applications.

2.1k7.8M57](/packages/dedoc-scramble)[nuwave/lighthouse

A framework for serving GraphQL from Laravel

3.5k10.7M93](/packages/nuwave-lighthouse)[thecodingmachine/graphqlite

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

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

This bundle provides tools to build a GraphQL server in your Symfony App.

8027.9M28](/packages/overblog-graphql-bundle)[wheelpros/fitment-platform-api

Magento 2 (Open Source)

12.1k1.2k](/packages/wheelpros-fitment-platform-api)

PHPackages © 2026

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