https://github.com/rbiedrawa/spring-graphql-federation-microservices-demo
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.
https://github.com/rbiedrawa/spring-graphql-federation-microservices-demo
apollo-federation apollo-server dgs-framework docker docker-compose gradle graphql kubernetes microservices netflix-oss node spring-boot
Last synced: 7 months ago
JSON representation
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.
- Host: GitHub
- URL: https://github.com/rbiedrawa/spring-graphql-federation-microservices-demo
- Owner: rbiedrawa
- License: mit
- Created: 2021-03-20T10:54:37.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2021-04-04T07:13:07.000Z (over 4 years ago)
- Last Synced: 2025-01-26T18:17:20.207Z (8 months ago)
- Topics: apollo-federation, apollo-server, dgs-framework, docker, docker-compose, gradle, graphql, kubernetes, microservices, netflix-oss, node, spring-boot
- Language: Java
- Homepage:
- Size: 411 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: Readme.md
- License: LICENSE
Awesome Lists containing this project
README
# Spring Boot GraphQL Federation Microservices (PoC)
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.
## Table of Content
- [Services](#services)
- [Architecture](#architecture)
- [Getting Started](#getting-started)
* [Installation](#installation)
* [Usage](#usage)
- [Deployment](#deployment)
* [Build](#build)
* [Docker](#docker)
* [Kubernetes](#kubernetes)
- [References](#references)
- [License](#license)## Services
* [Apollo Gateway](./services/gateway) - Apollo Server acting as the Federated Gateway.
* [Customer Service](./services/customer-service) - Spring Boot GraphQL application providing the federated Customer type.
* [Review Service](./services/review-service) - Spring Boot GraphQL application that extends the Customer type with reviews.## Architecture

## Getting Started
### Installation
Please refer to the individual readme files on instructions of how to run the services.
### Usage
* Start services.* Open [GraphQL playground GUI](http://localhost:4000/).
* Write the following query and tests the result:
- Find all customers with reviews (federated query)
```
query {
customers{
id
firstName
reviews{
id
rating
message
}
}
}
```
[e.g Federation Query Response](./_docs/img/federation-query.png)- Create new customer
```
mutation {
addCustomer(customer: { firstName: "New User" }) {
id
firstName
}
}
```## Deployment
### Build
You can build all the services by running the `buildDockerImages.sh` on Mac/Linux systems.
### Docker
Docker compose file with instructions are kept in [docker](deployment/docker) subdirectory.
### Kubernetes
Kubernetes manifests with instructions are kept in [k8s](deployment/k8s) subdirectory.
## References
* [GraphQL](https://graphql.org/)
* [Introduction to Apollo Server](https://www.apollographql.com/docs/apollo-server/)
* [Introduction to Apollo Federation](https://www.apollographql.com/docs/federation/)
* [DGS framework](https://netflix.github.io/dgs/)
* [Moving beyond REST: GraphQL and Java & Spring by Pratik Patel @ Spring I/O 2019](https://www.youtube.com/watch?v=iHxu2bq3fxI)## License
Distributed under the MIT License. See `LICENSE` for more information.