Kwuang's blog

The evolution of GraphQL frameworks

18 Jul 2020
posts graphql programming webdev

The origins of GraphQL #

GraphQL started in Facebook in 2012 as a way to more easily query data with less boilerplate. It allows simply ask for the exact fields you want, and have one query that queries many models at once, among other things. In 2015, Facebook decided to make it open source, and the GraphQL organization took over ownership of the specification and JavaScript reference implementation (GraphQL.js).

The first GraphQL-focused companies emerge #

Graphcool, founded in 2016, was one of the earliest companies to develop frameworks and systems that accelerated and made possible wider adoption of GraphQL in applications. Graphcool developed a framework comprised of a GraphQL database that could be hosted on the Graphcool Cloud, essentially a backend-as-a-service (BAAS). While this service was easy to use, it wasn't flexible or powerful enough for all use cases.

Apollo is another major player, founded by the same founders who brought us the Meteor framework. Apollo-server v1 was announced in July 2017, and brought a complete backend that was open source and extensible.

In October 2017, Apollo also released graphql-tools v2.0 with schema stitching, a handy feature that enabled building up larger schemas from multiple smaller ones.

Client-side libraries #

To accommodate these server-side libraries, client-side libraries soon followed that enabled web frontends, mobile apps, and other clients to be able to easily consume GraphQL APIs.

In 2016, Facebook created their own client library called Relay Classic. They released Relay Modern in April 2017 which was more extensible, easier to use, and more performant. Relay is now in v10.

[Apollo-client] reached v1 on March 30, 2017. Apollo-client v2 (released October 2017) was rewritten to be much more modular, and moved to using observables instead of promises. It also introduced Apollo-link as a client-side network layer.

Server-side libraries continue to evolve #

In January 2018, Graphcool released a new library called Prisma, a GraphQL layer over the database.

On May 15, 2018, Graphcool rebranded as Prisma to focus on the "engine" that originally powered Graphcool, allowing developers to build their own backend systems using a powerful database querying layer with GraphQL.

Apollo-engine was in conjunction with Apollo-client v2, enabling monitoring and visualizing the health and errors of applications.

Apollo-server 2.0 was released in July 2018. Compared to the first version of Apollo-server, it focused on improving developer experience, including best development patterns for common uses, and further abstractions.

Apollo-server v2 seems to have taken a lot of inspiration from Graphql-yoga, so much so that graphql yoga has effectively been deprecated.

GraphiQL is the reference implementation of the GraphQL IDE.

Prisma's GraphQL Playground then joined forces with GraphiQL, so that Playground 2.0 would be integrated.

express-graphql is one of the oldest GraphQL server frameworks for JavaScript. Because it is used as an Express middleware, it presents very little disruption to current systems already using a REST API, or those who are already familiar with GraphQL.

Graphcool also introduced graphql-yoga which sought to eliminate the boilerplate and manual work in configuring apollo-server and express-graphql.

yoga2 hasn't been actively maintained for over a year now, since Nexus is now the recommended way to use Prisma as a client-facing GraphQL API layer.

Dotan Simha created graphql-code-generator which autogenerates code.

graphqlgen was deprecated in favor of graphql-code-generator in August 2019.

TypeGraphQL is yet another framework. TypeGraphQL has an integration with Prisma.

Apollo Federation is an infrastructure-level technology. It allows microservices to individually implement separate schemas, and uses a "gateway" to present a unified API to the client.

Prisma 2.0 was released in Jan 21, 2020, after a rename: Photon.js became Prisma Client, and Lift became Prisma Migrate.

Even Amazon has jumped in with AWS Appsync in November 2017, offering real-time data sync between web and mobile applications, as a fully-managed hosted GraphQL solution.

Apollo-boost which advertises to be "The fastest, easiest way to get started with Apollo Client!" contains react-apollo, apollo-client, apollo-link, the in-memory cache, and more, is a fast way to get started with Apollo-client.

Present day news #

Apollo-client is now on v3.0 which focused the library on caching.

Nexus was originally created by Tim Griesser. On February 5, 2020, the original nexus transitioned to becoming @nexus/schema. And the Nexus package itself became a framework on top of @nexus/schema and moved to a new site, This aligned with a new line of thinking around how to best develop GraphQL software, a shift from schema-first to code-first.

Apollo-explorer was introduced on June 30, 2020. Apollo-explorer was renamed from Apollo Graph Manager, which was introduced last year.

Update (10/1/2020): Nexus Framework is now no longer maintained, so that the Nexus team could focus on @nexus/schema again. The nexus plugin for prisma will continue to work.

Update (10/9/2020): trojanowski/react-apollo-hooks became deprecated in Aug. 2019 when the official react-apollo hooks released a stable version, which then was moved inside Apollo Client in January 2020.

Alternative frameworks #

On the other hand, there are software that seek to be a batteries-included GraphQL API layer over an existing database, with little or no configuration or coding involved, such as Hasura and Postgraphile, both of which are open-source.

Blitz.js aims to entirely remove the concept of an API, enabled by full server-side rendering and templating with Next.js.

Redwood.js aims to be a fully serverless platform.

The future looks bright #

GraphQL tooling is still in its youth, and the future looks pretty exciting.

← Home