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

ActiveLibrary[API Development](/categories/api)

pascaldevink/graphql-federation
===============================

Utility for creating GraphQL microservices, which can be combined into a single endpoint through tools like Apollo Gateway

v0.1(6y ago)206026[2 issues](https://github.com/pascaldevink/php-graphql-federation/issues)[1 PRs](https://github.com/pascaldevink/php-graphql-federation/pulls)MITPHPPHP ^7.3CI failing

Since Oct 30Pushed 3mo ago3 watchersCompare

[ Source](https://github.com/pascaldevink/php-graphql-federation)[ Packagist](https://packagist.org/packages/pascaldevink/graphql-federation)[ RSS](/packages/pascaldevink-graphql-federation/feed)WikiDiscussions master Synced today

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

GraphQL Federation for PHP
==========================

[](#graphql-federation-for-php)

Utility for creating GraphQL microservices, which can be combined into a single endpoint through tools like Apollo Gateway.

[![Build Status](https://camo.githubusercontent.com/0be6b3cafa6cde3279282957dd79671fd17ae4358f9bb7b26f3eece3547927bc/68747470733a2f2f7472617669732d63692e6f72672f70617363616c646576696e6b2f7068702d6772617068716c2d66656465726174696f6e2e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/pascaldevink/php-graphql-federation)

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

[](#installation)

Use the package manager [composer](https://getcomposer.org) to install graphql-federation.

```
composer require pascaldevink/graphql-federation
```

Usage
-----

[](#usage)

Assuming you already have an existing GraphQL implementation using [webonyx/graphql-php](https://github.com/webonyx/graphql-php), these commands add federation:

```
# First, build your existing schema
$existingSchema = BuildSchema::build(file_get_contents(__DIR__ . '/schema.graphqls'));

# Then, extend it with Federation
$federation = new \PascalDeVink\GraphQLFederation\Federation();
$schema = $federation->extendSchema($existingSchema);

# Build your root value resolver
$rootValue = include __DIR__ . '/rootvalue.php';

# And extend it with Federation resolvers
$rootValue = $federation->addResolversToRootValue($rootValue);

# Finally, execute the query
GraphQL::executeQuery($schema, $query, $rootValue, null, $variableValues);
```

See [the example of webonyx/graphql-php](https://github.com/webonyx/graphql-php/tree/master/examples/02-shorthand)for the rest of the code to make it work.

Contributing
------------

[](#contributing)

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

Please make sure to update tests as appropriate.

License
-------

[](#license)

[MIT](https://choosealicense.com/licenses/mit/)

###  Health Score

35

↑

LowBetter than 80% of packages

Maintenance52

Moderate activity, may be stable

Popularity24

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity44

Maturing project, gaining track record

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

2385d ago

### Community

Maintainers

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

---

Tags

apollofederationgraphqlgraphql-federationgraphql-phpphpgraphqlFederationapollo

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/pascaldevink-graphql-federation/health.svg)

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

###  Alternatives

[nuwave/lighthouse

A framework for serving GraphQL from Laravel

3.5k10.7M93](/packages/nuwave-lighthouse)[overblog/graphql-bundle

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

8027.9M28](/packages/overblog-graphql-bundle)[aimeos/ai-admin-graphql

Aimeos Admin GraphQL API extension

944100.0k4](/packages/aimeos-ai-admin-graphql)[mll-lab/graphql-php-scalars

A collection of custom scalar types for usage with https://github.com/webonyx/graphql-php

1394.2M28](/packages/mll-lab-graphql-php-scalars)[ivome/graphql-relay-php

A PHP port of GraphQL Relay reference implementation

271632.4k5](/packages/ivome-graphql-relay-php)[overblog/graphql-php-generator

GraphQL types generator

29518.9k](/packages/overblog-graphql-php-generator)

PHPackages © 2026

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