Skip to content

Extension for axtiva/flexible-graphql-php for support apollo federation integration

Notifications You must be signed in to change notification settings

axtiva/graphql-federation-extension

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Flexible Graphql PHP Apollo Federation Extension

Library extend axtiva/flexible-graphql-php or webonyx/graphql-php functionality for work as subgraph service of Apollo Federation

Usage in

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:

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 

About

Extension for axtiva/flexible-graphql-php for support apollo federation integration

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages