A contrived Olympic Games example to demonstrate the aggregation of gRPC enabled web-services into a GraphQL middleware.
Each service corresponds to a resource out of this Olympics API. The types and fields in the graph may differ from this spec as it was simply used for inspiration and reference. The data produced by each service does not represent actual Olympic facts.
- Microservice design
- gRPC for inter-process communication
- GraphQL api for data aggregation from each service
- Rejoiner used to generate aggregated GraphQL schema from proto's and gRPC clients
Each service must be running before starting the GraphQL server.
./gradlew ws-athletes:run
./gradlew ws-countries:run
./gradlew ws-events:run
./gradlew ws-medals:run
./gradlew ws-olympics:run
./gradlew graphql-api:run
A GraphiQL instance is available at http://localhost:8080.
Run this introspection query to learn about supported types and their fields manually.
If you're using an apollo client, apollo-codegen can be used to generate the required schema file.
Post to http://localhost:8080/graphql
{"query":"query Olympics {olympics {id city host year season}}","variables":null,"operationName":"Olympics"}