PHPackages                             phonetworks/pho-compiler - 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. [Database &amp; ORM](/categories/database)
4. /
5. phonetworks/pho-compiler

ActiveLibrary[Database &amp; ORM](/categories/database)

phonetworks/pho-compiler
========================

Compiles GraphQL schema into PHP classes for use in Pho stack.

v2.x-dev(8y ago)085[2 issues](https://github.com/phonetworks/pho-compiler/issues)MITPHPPHP &gt;=5.3.0CI failing

Since Aug 15Pushed 6y ago1 watchersCompare

[ Source](https://github.com/phonetworks/pho-compiler)[ Packagist](https://packagist.org/packages/phonetworks/pho-compiler)[ Docs](https://phonetworks.org)[ RSS](/packages/phonetworks-pho-compiler/feed)WikiDiscussions master Synced 2d ago

READMEChangelogDependencies (11)Versions (5)Used By (0)

 [![](https://github.com/phonetworks/commons-php/raw/master/.github/cover-smaller.png)](https://github.com/phonetworks/commons-php/raw/master/.github/cover-smaller.png)

Pho-Compiler
=============

[](#pho-compiler-)

Compiles GraphQL schema into PHP executables for use throughout Phở stack.

Getting Started
---------------

[](#getting-started)

Please note, this repository uses submodules, for unit tests. The recommended way to install pho-compiler is through composer.

```
git clone https://github.com/phonetworks/pho-compiler
git submodule init
git submodule update
composer install
```

Schema
------

[](#schema)

### Recommendations

[](#recommendations)

A Phở-compatible GraphQL schema (also called a **"PhoGQL"** file) is advised to end with the following file extension: **.pgql**

### GraphQL

[](#graphql)

- PhởGQL is built on top of [GraphQL](http://graphql.org/). For more information on GraphQL specs, please visit .
- A PhoGQL file may include multiple entity definitions. However, it is advised to use (a) a single definition per file or (b) only a single semantically linked group of node and edge definitions per file.

### Versioning

[](#versioning)

- PhởGQL files must start with a version declaration. For version 1, the one and only version supported so far, it is `# pho-graphql-schema-v1`
- This declaration must be at the very top of the file and must not be preceded by any other word or character.
- The following regular expression pattern is used to match the version: `/^#( )*pho\-graphql\-v1(\r\n|\r|\n| )+/i`
- All future versions and their patterns will be placed in the file [Types.php](https://github.com/phonetworks/pho-compiler/blob/master/src/Pho/Compiler/Types.php)

### Types

[](#types)

- A PhởGQL definition must implement one of ActorNode, GraphNode, ObjectNode or ReadEdge, SubscribeEdge, TransmitEdge, WriteEdge entities. For more information on these entities, check out [pho-framework](http://github.com/phonetworks/pho-framework).
- While GraphQL allows multiple inheritance, the Phở compiler will evaluate only the first interface declared in each definition.

### Directives

[](#directives)

- Directives are case-insensitive. Similarly arguments are case-insensitive too.

Tips
----

[](#tips)

1. Start by defining the Actor edge
2. Outgoing edges are important.
3. Make sure all outgoing edges are done.

###  Health Score

23

—

LowBetter than 27% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity9

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity47

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

3039d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/a3b6d80630289b910b490ff8998d30fd7a83e346ee6568e91c5df5eaae64d294?d=identicon)[esokullu](/maintainers/esokullu)

---

Top Contributors

[![esokullu](https://avatars.githubusercontent.com/u/19166?v=4)](https://github.com/esokullu "esokullu (86 commits)")

---

Tags

schemagraphqlsqlsocialnetworkgraphData Modelinggraphql schemaschema model

###  Code Quality

TestsPHPUnit

Code StylePHP\_CodeSniffer

### Embed Badge

![Health badge](/badges/phonetworks-pho-compiler/health.svg)

```
[![Health](https://phpackages.com/badges/phonetworks-pho-compiler/health.svg)](https://phpackages.com/packages/phonetworks-pho-compiler)
```

###  Alternatives

[doctrine/dbal

Powerful PHP database abstraction layer (DBAL) with many features for database schema introspection and management.

9.7k578.4M5.6k](/packages/doctrine-dbal)[doctrine/doctrine-migrations-bundle

Symfony DoctrineMigrationsBundle

4.3k177.9M537](/packages/doctrine-doctrine-migrations-bundle)[cycle/database

DBAL, schema introspection, migration and pagination

64690.9k31](/packages/cycle-database)[aura/sqlschema

Provides facilities to read table names and table columns from a database using PDO.

41234.1k4](/packages/aura-sqlschema)[rolfvreijdenberger/izzum-statemachine

A superior statemachine library php &gt;= 5.3. Integrates with your domain models perfectly.

7425.5k](/packages/rolfvreijdenberger-izzum-statemachine)[stolz/laravel-schema-spy

Laravel artisan command that uses JAVA schemaSpy tool to generate a graphical representation of a database schema

4521.8k](/packages/stolz-laravel-schema-spy)

PHPackages © 2026

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