GraphQL server in Java: Part I: Basics

1 paź 2019 | Blog | programowanie | java | graphql | spring boot | IT
Near Zegrzyńskie Lake
Superficially, there is no reason GraphQL servers are typically written in Node.js. However callbacked-based languages that don’t block waiting for the result turn out to play really well with GraphQL philosophy. Before we dive into details why that’s the case, let us first understand how GraphQL server works underneath and how to implement it correctly. In the second installment we shall split the implementation to lazily load only necessary pieces of information. In the third installment we shall rewrite the server using non-blocking idioms to improve latency and throughput.

What is GraphQL

First things first, what is GraphQL? I’d say it lies somewhere between REST and SOAP (sic!) It’s a fairly lightweight, JSON protocol that works best for browsers and mobile apps. Just like REST. On the other hand it has a schema, describing valid attributes, operations and payloads. However, unlike SOAP, schema is designed to evolve and we have a great control over the scope of data we’d like to receive.

There are plenty of GraphQL tutorials out there, so let me jump straight to the example. Here is a fairly simple schema describing some API:

type Player {
id: String!
name: String!

POSTY TEGO AUTORA

See how Google is tracking your location. With Python, Jupyter, Pandas, Geopandas and Matplotlib30 mar 2020

Blog | programowanie | java | geopandas | gps | jupyter | matplotlib | pandas | python | IT

GraphQL server in Java: Part III: Improving concurrency23 mar 2020

Blog | programowanie | java | completablefuture | graphql | IT

GraphQL server in Java: Part II: Understanding Resolvers24 paź 2019

Blog | programowanie | java | graphql | IT

Fallbacks Are Overrated - Architecting For Resilience10 lip 2019

Blog | programowanie | java | software architecture | IT

Tomasz Nurkiewicz around Java and concurrency

noreply@blogger.com (Tomasz Nurkiewicz)