Graphcool, the GraphQL Backend Development Framework

Written by ChrisChinchilla | Published 2018/01/03
Tech Story Tags: graphql | api | database | backend | graphcool

TLDRvia the TL;DR App

I had encountered Graphcool around Berlin, as they organize and sponsor the community meetup, and I interviewed their CEO Johannes Schickling about what problem the company intended to solve and how.

A GraphQL Backend Development Framework

Graphcool helps you create and manage a database backend for GraphQL-powered applications, supplying permissions, mapping, subscriptions, a management UI, and a CRUD API for your data. You can use their hosted solution on AWS or self-host using Docker containers.

For example, this GraphQL type definition defines a simple article:

type Post @model { id:ID! @isUnique # read-only(managed by Graphcool) createdAt: DateTime! # read-only(managed by Graphcool) updatedAt: DateTime! # read-only(managed by Graphcool) description:String! imageUrl:String! }

And after a quick graphcool deploy command, Graphcool represents this as:

Then you can use the Graphcool playground (with the graphcool playground command) to try queries that interact directly with your application and the underlying data.

From here, you can use the API endpoints provided and connect applications to it. This means you can switch from endpoint to endpoint, for example, emulating development, staging, and production environments.

Under the hood, Graphcool stores your data in a SQL database. This is AWS Aurora for hosted clusters and MySQL for your own Docker-based installations. Emulating ORM-based frameworks such as Rails and Laravel, Graphcool supports migrations, allowing you to change your GraphQL schema over time. The process is the same as deploying your initial schema, and many of the principles relating to migrations apply, i.e. deleting or changing the field type if they have existing data might be tricky, and consider how this will affect your application.

There are a few other features I’ve not mentioned, so listen to the interview, read the documentation, and see how Graphcool could fit into your next project.

Originally published at dzone.com.


Written by ChrisChinchilla | Freelance technical communicator to the stars. Podcaster, video maker, writer of interactive fiction
Published by HackerNoon on 2018/01/03