CLOSE

Agile devops & continuous delivery

GraphQL

Definition of GraphQL

GraphQL is a schema definition language (SDL) and a query and update language (CRUD ops) designed by Facebook in 2012. It deals with the data layer of solutions and has been open source since 2015.

The SDL is designed for gathering the requested attributes exactly, avoiding underfetching and overfetching. It is implemented by different open source runtimes, which efficiently query/update numerous data sources at once.

As a schema-based approach, it enables design time validation.

GraphQL has a ‘subscription’ feature that allows a GraphQL server to notify its clients when a specific event happens.

It is de-facto used over HTTP (although that is not enforced by the standard), and is extended by some commercial products, e.g. Apollo, 8base.

GraphQL example avoiding overfetching and underfetching

GraphQL returning exactly the requested attributes (source)

Technology evaluation

GraphQL is an integration technique and tooling for the data layer of solutions. It is a good and efficient choice for the problems it was written for. Developers can expose APIs with less effort compared to a traditional OpenAPI approach.

Market - current adoption

GraphQL is popular with developers who need to query and update many data sources at once. Adoption was growing in recent years but seems to stabilize now.

GraphQL has often been compared to REST, and a debate on which is the better approach ensued. However, both are very different, and there is a growing consensus that there is no winner as this is an ‘apples vs oranges’ comparison. GraphQL is a query language and REST is an architectural paradigm.

Software AG supports GraphQL by both its Integration Server and its API Gateway.

Some public GraphQL APIs exist (Twitter, Github, Deutsche Bahn, …), but there is no broad adoption so far with regard to using GraphQL for public APIs (not even by Facebook).

Market - Outlook

Software AG expects the adoption rate of GraphQL to stabilize on the current level, due to its attractiveness for a certain common set of problems. However, Software AG does not see GraphQL becoming a standard for publicizing an API, in particular not becoming a successor of REST.