Skip to content

Demo repo to show a running integration of several graphql endpoints merged together with apollo federation

Notifications You must be signed in to change notification settings

t3n/graphql-federation-demo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

GraphQL Federation demo

This repository is a demo how to integrate a graphql endpoint based on t3n/graphql and t3n/graphql-apollofederation.

To read more about Apollo federation check out their documentation

This package includes:

  • Apollo Gateway
  • A flow distribution that has two graphql endpoints /user and /news
  • A nodejs graphql endpoint

Once everything is up and running you will see a single graphql endpoint that is merged together from all three endpoints.

To get started you need to run :

# Set up flow endpoints run composer update and bring up the flow server:
cd federation-flow
composer update
./flow server:run

# Set up avatar image endpoint
cd federation-user
npm i
npm run start

# finaly start the apollo gateway
cd apollo-gateway
npm i
npm run start

Now you have a running graphql playground at localhost:4000. A query like

query {
  allNews {
    identifier
    title
    author {
      identifier
      name
      avatarUrl
    }
  }
}

will fetch values from all three services in a single query.

About

Demo repo to show a running integration of several graphql endpoints merged together with apollo federation

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published