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)086[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 4w 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 25% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity9

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity47

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 79.6% 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

3132d 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)")[![groupsinc](https://avatars.githubusercontent.com/u/290835175?v=4)](https://github.com/groupsinc "groupsinc (22 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.7k614.3M7.3k](/packages/doctrine-dbal)[matomo/matomo

Matomo is the leading Free/Libre open analytics platform

21.7k39.6k](/packages/matomo-matomo)[kimai/kimai

Kimai - Time Tracking

4.8k9.4k1](/packages/kimai-kimai)[api-platform/metadata

API Resource-oriented metadata attributes and factories

275.5M254](/packages/api-platform-metadata)[cycle/database

DBAL, schema introspection, migration and pagination

71811.3k67](/packages/cycle-database)[perplorm/perpl

Perpl is an improved and still maintained fork of Propel2, an open-source Object-Relational Mapping (ORM) for PHP.

2414.4k](/packages/perplorm-perpl)

PHPackages © 2026

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