GraphQL Server With Java & Clients in Go and Rust

Image for post
Image for post

GraphQL it’s an interesting approach for Data Aggregation. GraphQL is a query language API for existing data. You can leverage all your REST APIs and existing data sources. GraphQL it’s mobile-friendly and you can ask literally just the fields you need. GraphQL also allows you to share queries and there are clients for pretty much all languages. GraphQL allows you multiplex and de-multiplex multiple requests in one, being really great for tail latency and nice for data-intensive applications. However, not everything in graphql is flowers and I dont want to paint a rosy picture. There are issues and tradeoffs you need to take into account. I highly recommend you read these 3 series of posts I made comparisons with other approaches like BFs. BFF and GraphQL Dilemma part 1, part 2, and part 3. Today I want to share a video I made where there is a GraphQL Server written in Java and we have 2 clients one Written in Go Lang and the other written in Rust. So Let’s get started.

The video

The Code

GraphQL Server — Written in Java with JDK 15 and Maven 3

GraphQL Client — Written in Go Lang with Machinebox/GraphQL

GraphQL Client — Written in Rust with graphql_client

Cheers,

Diego Pacheco

Originally published at http://diego-pacheco.blogspot.com on November 24, 2020.

Written by

Brazilian, Software Architect, SWE(Java, Scala, Rust, Go) SOA & DevOps expert, Author. Working with EKS/K8S. diegopacheco.github.io (Opinions on my own)

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store