Skip to content

stringbeans/nest-federation-example

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 

Repository files navigation

GraphQL Federation - Code First

A simple example of GraphQL Federation using Code First approach.

Execution

Make sure to start the two sub-graph applications first, then the gatway. Otherwise the gateway won't be able to fetch schemas from the sub-graphs.

cd users-application && npm run start
cd posts-application && npm run start
cd gateway && npm run start

Access the graph

You can reach the gateway under http://localhost:3002/graphql

Query a combined graph

query getUserWithPosts($userId: ID!) {
  getUser(id: $userId) {
    id
    name
    posts {
      authorId
      id
      title
    }
  }
}

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published