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

ActiveLibrary[API Development](/categories/api)

phpnomad/graphql
================

Abstract GraphQL interfaces for the PHPNomad ecosystem

v1.0.0(3mo ago)03.0k2MITPHPPHP &gt;=8.2CI failing

Since Mar 3Pushed 1w agoCompare

[ Source](https://github.com/phpnomad/graphql)[ Packagist](https://packagist.org/packages/phpnomad/graphql)[ Docs](https://github.com/phpnomad/core)[ RSS](/packages/phpnomad-graphql/feed)WikiDiscussions main Synced 3w ago

READMEChangelog (2)Dependencies (2)Versions (2)Used By (2)

phpnomad/graphql
================

[](#phpnomadgraphql)

[![Latest Version](https://camo.githubusercontent.com/1e0d12b259d63c4fdb442924b442bf3a5f99e25a8c886f6e17a6f2faf1d3e0f3/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f7068706e6f6d61642f6772617068716c2e737667)](https://packagist.org/packages/phpnomad/graphql) [![Total Downloads](https://camo.githubusercontent.com/2a9e8543f9771e8b4f38ff514ff005a00ebf314a60ccaa0cdb631aaf19334495/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f7068706e6f6d61642f6772617068716c2e737667)](https://packagist.org/packages/phpnomad/graphql) [![PHP Version](https://camo.githubusercontent.com/e25e8aa7e757453b90c7b4f4bf9097fc37c5d369397111517f4c8c3dd484f397/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f7068702d762f7068706e6f6d61642f6772617068716c2e737667)](https://packagist.org/packages/phpnomad/graphql) [![License](https://camo.githubusercontent.com/21302711e96a22787022d27f7537b6dd1574d2bde56664271fcae0037e0aea1a/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f7068706e6f6d61642f6772617068716c2e737667)](https://packagist.org/packages/phpnomad/graphql)

`phpnomad/graphql` is an engine-agnostic GraphQL abstraction for [PHPNomad](https://phpnomad.com). It defines the contracts your application writes against (`TypeDefinition`, `FieldResolver`, `GraphQLStrategy`, and `ResolverContext`) so that type definitions and resolvers stay portable across whichever GraphQL engine you plug in underneath. Your schema code depends only on these interfaces, which keeps it decoupled from the runtime library and easy to test in isolation.

The package itself ships five interfaces and a single exception class, not a runtime. The recommended concrete strategy lives in [`phpnomad/webonyx-integration`](https://packagist.org/packages/phpnomad/webonyx-integration), which adapts these interfaces to [`webonyx/graphql-php`](https://github.com/webonyx/graphql-php). Install both together when you want a working GraphQL layer.

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

[](#installation)

```
composer require phpnomad/graphql
```

For a concrete engine, also pull in the webonyx strategy:

```
composer require phpnomad/webonyx-integration
```

Quick Start
-----------

[](#quick-start)

A `TypeDefinition` returns an SDL string and a resolver map. Only fields that need custom logic require a resolver entry. All other fields fall back to the engine's default property resolution.

```
