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 federatedShowtypereviews: A Java GraphQL service that extends theShowtype withreviewsapollo-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.
- Start
showby running the Spring Boot app from the IDE - Start
reviewsby running the Spring Boot app from the IDE - Run
npm installin theapollo-gatewayproject - Run
node index.jsin theapollo-gatewayproject - Open http://localhost:4000 for the query editor
The following is a federated query that should work.
{
shows {
title
reviews {
starRating
}
}
}