Awesome
[!WARNING] This repository has been archived now that GraphQL Java Kickstart : GraphQL Spring Boot has also been archived.
I recommend taking a look at either Netflix DGS or Spring GraphQL documentation sites.
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
typereviews
: 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
}
}
}