Skip to content

Graphile vs GraphQL.js

Which should you use? A side-by-side look at what each one does, who it suits, what it costs, how hard it is to set up, and where each falls short.

Graphile

Open source · MIT

A monorepo of GraphQL tools, including Grafast and PostGraphile for building APIs from PostgreSQL.

GraphQL.js

Open source · MIT

JavaScript reference implementation of GraphQL, a query language for APIs.

The short answer

Choose Graphile if you need…

  • Developers who have a PostgreSQL database and want an auto-generated GraphQL API
  • Teams building custom GraphQL schemas who care about server efficiency
  • Developers who want a GraphQL API they can still customise heavily
  • Developers looking for individual Node.js libraries for SQL building or Postgres introspection

Choose GraphQL.js if you need…

  • JavaScript or TypeScript developers building a GraphQL API on Node.js
  • Developers who want the reference implementation that other GraphQL tools are built on
  • Teams building browser-side tools that work with GraphQL schemas

Side-by-side

GraphileGraphQL.js
TypeFrameworkLibrary
PriceFree and open sourceFree and open source
LicenceMITMIT
GitHub stars12.9k20.3k
Setup difficultyAdvancedIntermediate
How you get itInstall with a package managerInstall with a package manager
Main languageTypeScriptTypeScript
Last code update4 days ago4 days ago

What each one is

Graphile

This repository holds many related open-source packages from Graphile, a project focused on GraphQL. The two headline projects are Grafast, a planning and execution engine that can replace the execute method in GraphQL.js, and PostGraphile, which builds a GraphQL API automatically from a PostgreSQL database. Other packages, such as pg-sql2 for building SQL queries and pg-introspection for reading database structure, can be used on their own.

GraphQL.js

GraphQL.js is the official JavaScript implementation of GraphQL, a query language for APIs originally created by Facebook. It lets developers define a typed schema that maps to their code, then run queries against that schema, with validation of queries before they execute. It works in both Node.js servers and browsers.

Best for

Graphile

  • Developers who have a PostgreSQL database and want an auto-generated GraphQL API
  • Teams building custom GraphQL schemas who care about server efficiency
  • Developers who want a GraphQL API they can still customise heavily
  • Developers looking for individual Node.js libraries for SQL building or Postgres introspection

GraphQL.js

  • JavaScript or TypeScript developers building a GraphQL API on Node.js
  • Developers who want the reference implementation that other GraphQL tools are built on
  • Teams building browser-side tools that work with GraphQL schemas

Strengths

Graphile

  • Covers a range of related GraphQL and PostgreSQL tools in one place
  • Several packages can be used independently of the rest
  • MIT licensed and actively maintained, with a recent push to the repository

GraphQL.js

  • Maintained as the reference implementation of the GraphQL specification for JavaScript
  • Ships both CommonJS and ES module builds, so it works with most bundlers
  • Released under the permissive MIT license

Not ideal for

Graphile

  • People who do not use PostgreSQL, since PostGraphile is designed around it
  • People who need the legacy PostGraphile V4, which lives on a separate branch
  • Beginners with no Node.js or GraphQL experience, as the README assumes familiarity with both

GraphQL.js

  • People who only want to call an existing GraphQL API and do not write server code; a client library would fit better
  • Non-developers, since the README assumes familiarity with JavaScript and schemas

Trade-offs

Graphile

  • The README is truncated and gives limited setup detail, so setup is not clear from this text alone
  • Many packages and concepts make the monorepo hard to navigate for newcomers
  • Some packages are niche and the README itself recommends alternatives for one of them

GraphQL.js

  • The README's getting-started material is brief; fuller documentation is on external sites
  • Building a full API typically needs additional libraries not covered in this README
  • Contributions require signing a GraphQL Specification Membership agreement

Getting started

Graphile

Clone the repository

git clone https://github.com/graphile/crystal
Step-by-step guide: how to use Graphile

GraphQL.js

Install with npm

npm install --save graphql

Install with yarn

yarn add graphql
Step-by-step guide: how to use GraphQL.js

Frequently asked questions

What is the difference between Graphile and GraphQL.js?

Graphile: A monorepo of GraphQL tools, including Grafast and PostGraphile for building APIs from PostgreSQL. GraphQL.js: JavaScript reference implementation of GraphQL, a query language for APIs. Graphile suits developers who have a postgresql database and want an auto-generated graphql api, while GraphQL.js suits javascript or typescript developers building a graphql api on node.js.

Are Graphile and GraphQL.js free?

Graphile: Free and open source. GraphQL.js: Free and open source.

Which is easier to set up, Graphile or GraphQL.js?

GraphQL.js is easier to get started with (rated intermediate); Graphile is rated advanced and usually needs more setup.

Is Graphile or GraphQL.js more popular?

GraphQL.js has more GitHub stars (20.3k) than Graphile (12.9k). Popularity isn't the same as fit — check which one matches your use case above.

What are other alternatives to Graphile and GraphQL.js?

Other options people compare them with include Apollo Server, Yoga.

Keep comparing

Built from our catalogue entries for both products: open-source details come from each project's README (AI-assisted, refreshed weekly) and GitHub data; AI-tool details are editorial. Spotted something wrong? Let us know from either product's page.