Apollo Federation JVM example implementation using Spring GraphQL. If you want to discuss the project or just say hi, stop by the Apollo community forums.
The repository contains three separate projects:
products-subgraph
: A Java GraphQL service providing the federatedProduct
typereviews-subgraph
: A Java GraphQL service that extends theProduct
type withreviews
gateway
: An instance of Apollo Server acting as the Federated Gateway
See individual projects READMEs for detailed instructions on how to run them.
- Start
products-subgraph
by running the Spring Boot app from the IDE or by running./gradlew bootRun
fromproducts-subgraph
project - Start
reviews-subgraph
by running the Spring Boot app from the IDE or./gradlew bootRun
fromreviews-subgraph
project - Start Federated Gateway
- Install required packages by running
npm install
in thegateway
project - Start gateway by running
npm run start
in thegateway
project
- Install required packages by running
- Open http://localhost:4000 for the query editor
Example federated query
query ExampleQuery {
products {
id
name
description
reviews {
id
text
starRating
}
}
}