PHPackages                             galahad/graphoquent - 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. galahad/graphoquent

ActiveProject[API Development](/categories/api)

galahad/graphoquent
===================

Expose your eloquent models as GraphQL queries and mutations

06PHP

Since Aug 18Pushed 8y ago2 watchersCompare

[ Source](https://github.com/glhd/graphoquent)[ Packagist](https://packagist.org/packages/galahad/graphoquent)[ RSS](/packages/galahad-graphoquent/feed)WikiDiscussions master Synced 4w ago

READMEChangelogDependenciesVersions (1)Used By (0)

Graphoquent
===========

[](#graphoquent)

Graphoquent is a Laravel packages that turns Eloquent models into queryable GraphQL objects.

Automatic Type Inference
========================

[](#automatic-type-inference)

By default, Graphoquent tries to infer your model's type from three places:

1. The model's `$casts` array
2. The model's `$dates` array
3. The model's `@property` and `@property-read` DocBlock annotations

Given the following model:

```
/**
 * @property int $count
 */
class Foo extends Model
{
  use \Galahad\Graphoquent\Queryable;

  protected $casts = [
    'stars' => 'float',
  ];

  protected $dates = [
    'created_at',
  ];
}
```

Graphoquent will build the following GraphQL Type:

```
type Foo {
  count: Int
  stars: Float
  created_at: String
}
```

Authorization
=============

[](#authorization)

Gates &amp; Policies
--------------------

[](#gates--policies)

Graphoquent uses Laravel Gates for default authorization:

- `expose`: Can this user (or `null` if not logged in) use [introspection](http://graphql.org/learn/introspection/)to lear about this Type?

Custom
------

[](#custom)

You may provide custom authorization for any Model by defining an `authorizeGraphQL` method on the model:

```
public function authorizeGraphQL($actor, $ability)
{
	if ('expose' === $ability) {
		return true;
	}

	return $actor && $actor->id === $this->owner_id;
}
```

###  Health Score

20

—

LowBetter than 13% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity41

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.

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/21592?v=4)[Chris Morrell](/maintainers/inxilpro)[@inxilpro](https://github.com/inxilpro)

---

Top Contributors

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

---

Tags

eloquent-modelsgraphql

### Embed Badge

![Health badge](/badges/galahad-graphoquent/health.svg)

```
[![Health](https://phpackages.com/badges/galahad-graphoquent/health.svg)](https://phpackages.com/packages/galahad-graphoquent)
```

###  Alternatives

[exsyst/swagger

A php library to manipulate Swagger specifications

35816.3M7](/packages/exsyst-swagger)[hubspot/api-client

Hubspot API client

24015.5M18](/packages/hubspot-api-client)[pocketmine/bedrock-protocol

An implementation of the Minecraft: Bedrock Edition protocol in PHP

172437.8k11](/packages/pocketmine-bedrock-protocol)[botman/driver-telegram

Telegram driver for BotMan

94452.6k6](/packages/botman-driver-telegram)

PHPackages © 2026

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