Menu

React, etc. Tech Stack

React, Flux, GraphQL, Hack, HHVM...? All of this and more!

PostGraphile creates a GraphQL API from a PostgreSQL schema

GraphQL continues to make headlines as does Postgres - the veteran Open Source relational database. What brings these two technologies together is a project called PostGraphile.

Previously known as PostGraphQL the project is a simple-to-use Node.js application that exposes the underlying PostgreSQL database's SQL schema through a GraphQL API.

Despite the GraphQL being a new project, it has a long history and can be considered stable. The PostGraphQL project was unveiled at the GraphQL Summit in 2016 and has continued strong momentum. The name change is mostly a branding effort as the original name is admittedly somewhat cumbersome to use.

PostGraphile being the latest incarnation of the GraphQL layer for PostgreSQL continues on this path. The application provides a layer that exposes the relational database schema and it's contents automatically via a GraphQL compliant API through HTTP. A perfect companion for a Universal JavaScript framework like Next.js or Nuxt.js.

The application has high performance, written in contemporary JavaScript running on Node.js - a high performance JavaScript JIT runtime on the server. Unlike with "NoSQL" databases like MongoDB, the database layer of the stack - PostgreSQL is known for being a robust and performant database. Security is also catered for as GraphQL uses Postgres users and roles to control access.

In addition to PostGraphile, the Graphile project now adds a new toolkit to construct GraphQL APIs decoupled from the storage layer. This project is known as Graphile Build and comes complete with comprehensive documentation on how to enable GraphQL compliant Node.js APIs for existing applications.

Update: The Graphcool team recently announced Prisma, an interesting alternative to PostGraphile

Written by Jorgé on Monday January 15, 2018

Permalink -

« GraphCMS is an Open Source alternative to Contentful - After.js, an alternative take on Next.js »