PHPackages                             segbedji/graphql-typed - 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. segbedji/graphql-typed

ActiveStatamic-addon[API Development](/categories/api)

segbedji/graphql-typed
======================

A Statamic addon that adds type-safe GraphQL arguments for collections, filters, and enums.

v0.1.0(1mo ago)02↑2900%MITPHP

Since Mar 23Pushed 1mo agoCompare

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

READMEChangelogDependencies (2)Versions (2)Used By (0)

GraphQL Typed
=============

[](#graphql-typed)

A Statamic addon that adds type-safe GraphQL arguments for better developer experience when using typed GraphQL clients.

The Problem
-----------

[](#the-problem)

Statamic's default GraphQL schema uses `String` for collection names and `JsonArgument` for filters:

```
entries(collection: [String], filter: JsonArgument, ...): EntryInterfacePagination
```

This means GraphQL clients like gqty, graphql-codegen, or Apollo can't provide autocomplete or type checking for these arguments.

The Solution
------------

[](#the-solution)

This addon replaces the `collection` argument with a dynamically generated `CollectionName` enum based on your actual collections:

```
enum CollectionName {
  ARTICLES
  PAGES
  # ... auto-generated from your collections
}

entries(collection: [CollectionName], ...): EntryInterfacePagination
```

Features
--------

[](#features)

- Dynamically generates `CollectionName` enum from your Statamic collections
- Overrides the default `entries` query to use the typed enum
- Zero configuration required - just install and regenerate your client types

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

[](#installation)

```
composer require segbedji/graphql-typed
```

Usage
-----

[](#usage)

After installing, regenerate your GraphQL client types. The `collection` argument will now be typed as `CollectionName` enum instead of `String`.

### Before (untyped)

[](#before-untyped)

```
query.entries({ collection: ['articles'] }) // 'articles' is just a string, no validation
```

### After (typed)

[](#after-typed)

```
query.entries({ collection: [CollectionName.ARTICLES] }) // Type-safe enum value
```

How It Works
------------

[](#how-it-works)

The addon registers:

1. **CollectionNameEnum** - A GraphQL enum type that dynamically generates values from `Collection::all()`
2. **TypedEntriesQuery** - Extends the default `EntriesQuery` but uses the `CollectionName` enum for the `collection` argument

Future Improvements
-------------------

[](#future-improvements)

- Add typed filter inputs per collection based on blueprint fields
- Add typed sort options based on available fields
- Support for typed `entry` query (singular)

###  Health Score

31

—

LowBetter than 68% of packages

Maintenance90

Actively maintained with recent releases

Popularity3

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity23

Early-stage or recently created project

 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

47d ago

### Community

Maintainers

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

---

Top Contributors

[![JustinyAhin](https://avatars.githubusercontent.com/u/33403964?v=4)](https://github.com/JustinyAhin "JustinyAhin (2 commits)")

---

Tags

enumgraphqlfiltersstatamictyped

### Embed Badge

![Health badge](/badges/segbedji-graphql-typed/health.svg)

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

###  Alternatives

[webonyx/graphql-php

A PHP port of GraphQL reference implementation

4.7k77.3M332](/packages/webonyx-graphql-php)[nuwave/lighthouse

A framework for serving GraphQL from Laravel

3.5k10.7M92](/packages/nuwave-lighthouse)[statamic/cms

The Statamic CMS Core Package

4.8k3.2M720](/packages/statamic-cms)[overblog/graphql-bundle

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

8027.9M28](/packages/overblog-graphql-bundle)[smile/elasticsuite

Magento 2 merchandising and search engine built on ElasticSearch

8044.5M33](/packages/smile-elasticsuite)[gmostafa/php-graphql-client

GraphQL client and query builder.

3217.6M24](/packages/gmostafa-php-graphql-client)

PHPackages © 2026

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