Skip to content

MrSquaare/31-graphql-federation-code-first

Repository files navigation

GraphQL Federation - Code First

A tweaked example of GraphQL Federation using Code First approach. (original example)

Execution

First, build types and entities:

npm -w types run build

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

npm -w users-application run start
npm -w posts-application run start
npm -w somethings-application run start
npm -w gateway 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