graphql-java-kickstart-federation-example
graphql-java-kickstart-federation-example copied to clipboard
A GraphQL Java Kickstart federation example, ported from netflix/dgs-federation-example.
A GraphQL Java Kickstart / GraphQL Spring Boot federation example, ported from netflix/dgs-federation-example.
The repository contains three separate projects:
-
shows
: A Java GraphQL service providing the federatedShow
type -
reviews
: A Java GraphQL service that extends theShow
type withreviews
-
apollo-gateway
: An instance of Apollo Server acting as the Federated Gateway
The shows
and reviews
projects are Maven projects.
The apollo-gateway
is a Node project.
Running the demo
- Start
show
by running the Spring Boot app from the IDE - Start
reviews
by running the Spring Boot app from the IDE - Run
npm install
in theapollo-gateway
project - Run
node index.js
in theapollo-gateway
project - Open http://localhost:4000 for the query editor
The following is a federated query that should work.
{
shows {
title
reviews {
starRating
}
}
}