Spring Boot GraphQL microservices demo that shows how to use DGS framework together with Apollo Federation Server.
All applications can be run locally, inside docker or kubernetes cluster.
- Apollo Gateway - Apollo Server acting as the Federated Gateway.
- Customer Service - Spring Boot GraphQL application providing the federated Customer type.
- Review Service - Spring Boot GraphQL application that extends the Customer type with reviews.
Please refer to the individual readme files on instructions of how to run the services.
-
Start services.
-
Open GraphQL playground GUI.
-
Write the following query and tests the result:
- Find all customers with reviews (federated query)
query { customers{ id firstName reviews{ id rating message } } }
- Create new customer
mutation { addCustomer(customer: { firstName: "New User" }) { id firstName } }
You can build all the services by running the buildDockerImages.sh
on Mac/Linux systems.
Docker compose file with instructions are kept in docker subdirectory.
Kubernetes manifests with instructions are kept in k8s subdirectory.
- GraphQL
- Introduction to Apollo Server
- Introduction to Apollo Federation
- DGS framework
- Moving beyond REST: GraphQL and Java & Spring by Pratik Patel @ Spring I/O 2019
Distributed under the MIT License. See LICENSE
for more information.