axtiva / graphql-federation-extension
Extension for axtiva/flexible-graphql-php for support apollo federation integration
Installs: 4 850
Dependents: 1
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 0
Requires
- php: >=7.4
- webonyx/graphql-php: ^14.0
Requires (Dev)
- phpunit/phpunit: ^9.5
This package is auto-updated.
Last update: 2025-03-05 06:22:42 UTC
README
Library extend axtiva/flexible-graphql-php or webonyx/graphql-php functionality for work as subgraph service of Apollo Federation
Usage in
- axtiva/flexible-graphql-bundle - add support of federation resolvers
Setup
Install by composer
composer require axtiva/graphql-federation-extension
Demo integration
Demo projects with
Demo Federated schema
How to do look at directory example:
- How to setup apollo federated schema see at example/extend_schema.php
Run on project root directory:
php -S localhost:8080 ./example/extend_schema.php
Now you can send http graphql requests to http://localhost:8080
Get common graphql request
query{ account(id:234) { id number transactions { id amount } } }
Get federated representation request
query{ _entities(representations: [ {__typename: "Account", id: 123} {__typename: "Transaction", id: 333} ]) { __typename ...on Account { id number } ...on Transaction { id amount } } }
Tests
Run tests
php vendor/bin/phpunit