Open-source project
rmosolgo/graphql-ruby avatar
rmosolgo/graphql-ruby

graphql-ruby: the Ruby GraphQL server, its Pro tier and what the README leaves out

Ruby implementation of GraphQL

5,444 stars1,418 forksRubyMIT

At a glance

What is it?
graphql-ruby is the Ruby implementation of GraphQL, distributed as the graphql gem and wired into Rails by a generator. The core runtime is MIT-licensed; persisted queries, API versioning, streaming payloads, server-side caching and rate limiters are sold separately as GraphQL::Pro.
Who is it for?
Adopt graphql-ruby if you are building a GraphQL server in Ruby, especially on Rails, and you want a plain-Ruby schema definition rather than a DSL bolted onto another language. Do not adopt it if you need persisted queries, API versioning, streaming payloads, server-side caching or rate limiters out of the box and you are not prepared to buy GraphQL::Pro, since the README lists all of those as Pro features.
Can I use it commercially?
Yes. MIT is a permissive licence: you can use, modify and sell software built on it, as long as you keep its copyright and licence notices.
Is it still maintained?
Yes. The repository last received commits 1 day ago.
What is it written in?
Mainly Ruby, according to GitHub's language statistics.

Answers come from the project's GitHub data, last synced on September 29, 2026, and from our analysis. They are not legal advice.

Editorial analysis

What graphql-ruby is for, and who ends up using it

graphql-ruby is a Ruby implementation of the GraphQL specification. The README states its goals directly: implement the GraphQL spec and support a Relay front end, provide an idiomatic plain-Ruby API with similarities to the reference implementation where possible, and support Ruby on Rails and Relay. That last clause is the honest summary of the audience. If you are writing a Rails application and you want a typed query layer in front of your models, this is the library the Ruby ecosystem points at. If you are writing a standalone Ruby service with Sinatra or plain Rack, the runtime still works, but the generator-driven setup described in the README assumes Rails.

The repository layout tells you what you are buying into. There is a lib/ directory holding the runtime, a spec/ directory, a benchmark/ directory, a guides/ directory, a javascript_client/ directory, and a graphql-c_parser/ directory. That last one matters: the parser has a separate C extension gem, so a pure-Ruby parse path exists alongside a faster native one. There are also separate changelogs for the core, for Relay, and two for the commercial tiers (CHANGELOG-pro.md and CHANGELOG-enterprise.md), which is a useful signal that the free and paid surfaces move on different schedules.

How the runtime is put together

The architecture visible from the repository is a Ruby object graph. You define types, fields and resolvers in Ruby classes, and the runtime walks a parsed query document against them. The README's goal of an "idiomatic, plain-Ruby API" is the design constraint: schema definitions are ordinary Ruby, not a separate schema language compiled ahead of time, so you can use constants, inheritance and metaprogramming inside them.

The related searches around this project cluster on the parts of that object graph people actually touch: resolvers, fields, mutations, enums, context, pagination and Dataloader. Dataloader is the batching layer, and its presence in the search data is not surprising, because the classic failure mode of a naive GraphQL server is N+1 queries: a list field resolves, each item resolves a nested association, and the database gets hit once per item. Dataloader exists to batch those lookups into one call per association per request. Context is the per-request bag that resolvers read from, typically carrying the current user and authorization state.

The repository also ships a javascript_client/ directory and a Relay changelog, which reflects the second half of the stated goal. A Relay-compatible server has to implement the connection-based pagination and node-identifier conventions, and that is a schema-shape commitment, not a runtime switch.

Installing graphql-ruby and running the Rails generator

Installation is a Gemfile entry plus a bundle, exactly as the README shows. Add the gem to your Gemfile:

ruby
# Gemfile
gem 'graphql'

Then install it:

bash
$ bundle install

The README then gives the Rails path, which is a single generator:

bash
$ rails generate graphql:install

Read the README's warning before you run it: after this, you may need to run bundle install again, because graphiql-rails is added on installation by default. That is a real dependency decision made on your behalf. graphiql-rails pulls in the in-browser GraphiQL IDE, which is convenient in development and something you will want to keep out of production, and the README does not document a flag to skip it. If you are not on Rails, the README points you at the Getting Started page on graphql-ruby.org instead of giving a non-Rails recipe.

After the generator, the first real use is opening the GraphiQL endpoint it mounts and issuing a query against the generated schema. The README does not spell out the route or the default type name, so take those from the generated files in your own application rather than from this article.

The Pro line is the real boundary of the free gem

The README's Upgrade section is unusually candid, and it is the single most important thing to read before adopting. It lists what GraphQL::Pro provides on top of the runtime: persisted queries, API versioning, streaming payloads, server-side caching, rate limiters, subscription backends for Pusher and Ably, and authorization plugins for Pundit and CanCan. Pro customers also get email support.

That list covers a lot of what production GraphQL deployments end up needing. Persisted queries in particular is the standard answer to the problem of clients sending large query documents over the wire and servers accepting arbitrary ones; the related searches show people looking for exactly this. Streaming payloads is the mechanism behind incremental delivery. Rate limiters and server-side caching are the two things every public API eventually grows by hand if the framework does not supply them.

The trade-off is worth stating plainly: the free gem gives you a conformant runtime, and the operational features that make a public GraphQL API survivable sit behind a commercial licence. That is a legitimate funding model for a project this size, and the README does not hide it. It does mean that a cost estimate for a graphql-ruby deployment is incomplete until you have decided which of those seven items you need. The README does not document pricing, so that is a conversation with the maintainer, not something you can read off the repository.

Where graphql-ruby is the wrong choice

The clearest case against it is a team that wants a schema-first workflow. graphql-ruby's stated goal is a plain-Ruby API, which means your schema lives in Ruby code. If your organisation wants a single .graphql schema file as the source of truth, reviewed independently of application code and shared with non-Ruby consumers, you are working against the library's design rather than with it. The generated artifacts you would want do not come from the runtime.

The second case is a non-Ruby service. The repository is a Ruby implementation with a Ruby gem as its distribution channel and a Rails generator as its documented entry point. Nothing in the README offers another host language or a language-agnostic server binary, and the graphql-c_parser directory is a C extension for Ruby's own parser, not a general-purpose parser you can link elsewhere.

The third case is subtler: if you need persisted queries or rate limiting on day one and cannot buy Pro, you will be writing those layers yourself on top of the runtime. That is possible, but it means the framework is not doing the job you selected it for, and you should price the work accordingly before you start.

How it differs from graphql-js and other implementations

The obvious alternative is graphql-js, the JavaScript reference implementation. The difference is not only the host language. graphql-js is the reference the spec is written against, and graphql-ruby's README explicitly aims for "similarities to reference implementation where possible" while keeping a plain-Ruby API. In practice that means naming and shape often line up, but the Ruby library makes its own choices where Ruby idiom and the reference diverge.

The more consequential difference for a Rails team is where the schema lives. With graphql-js you are typically building a Node service alongside your Rails application, which means a second deployment, a second set of credentials to the same database or an internal API between the two, and a second place to enforce authorization. graphql-ruby keeps the schema inside the Rails process, so your existing authentication, your existing models and your existing authorization libraries are directly reachable from resolvers. For a team whose data and business logic are already in Rails, that is the whole argument.

Against that, a Node service can be scaled and deployed independently of the Rails monolith, and the JavaScript ecosystem around GraphQL tooling is larger. If your front end team already runs Node and your Rails app is a thin API, the calculus changes.

Maintenance, releases and what the changelogs tell you

The repository is not archived, and the last push was on 2026-09-22. The release history is worth reading carefully rather than skimming. The most recent listed release is v1.11.12 from 2025-07-19, while v1.12.4 and v1.12.3 are dated 2021-02-12 and 2021-01-29. That is not a clean ascending version sequence, and it is a reminder that the release feed you see is a partial view. Before you pin a version, read CHANGELOG.md and CHANGELOG-relay.md in the repository, and note that CHANGELOG-pro.md and CHANGELOG-enterprise.md exist as separate files, so a change you are waiting for may be documented only in one of those.

The upgrade cost has two components. The first is the usual Ruby gem problem: a major version bump can change schema definition APIs, and because your schema is Ruby code rather than a declarative file, the compiler cannot tell you what broke. Your spec/ suite is the migration tool. The second is the Pro boundary. If you adopt a Pro feature and later stop paying, the upgrade path back to the free runtime is not something the README documents.

On licensing: the gem is MIT-licensed, with MIT-LICENSE at the repository root, which is permissive and places few obligations on you. GraphQL::Pro is a separate commercial product sold by the maintainer, and the README describes it as something you buy. The repository contains CHANGELOG-pro.md and CHANGELOG-enterprise.md, which suggests the commercial code is developed alongside the open source runtime, but the README does not state the terms of the Pro licence. Read those terms yourself; this is a commercial agreement, not a licence file you can skim like MIT.

Editorial conclusion

Adopt graphql-ruby if you are building a GraphQL server in Ruby, especially on Rails, and you want a plain-Ruby schema definition rather than a DSL bolted onto another language. Do not adopt it if you need persisted queries, API versioning, streaming payloads, server-side caching or rate limiters out of the box and you are not prepared to buy GraphQL::Pro, since the README lists all of those as Pro features. Before committing, verify three things: which licence your organisation is comfortable with for the Pro tier, whether graphiql-rails is acceptable as an added dependency after the install generator runs, and how the versioning story in CHANGELOG.md and CHANGELOG-pro.md maps onto the release you pin.

Frequently asked questions

What is graphql-ruby and who is it for?

It is a Ruby implementation of the GraphQL specification, distributed as the graphql gem. The README states its goals as implementing the spec, supporting a Relay front end, and providing an idiomatic plain-Ruby API, with explicit support for Ruby on Rails and Relay.

How do I install graphql-ruby in a Rails app?

Add gem 'graphql' to your Gemfile and run bundle install, then run rails generate graphql:install. The README notes you may need to run bundle install again afterwards because graphiql-rails is added on installation by default.

Does graphql-ruby support persisted queries?

The README lists persisted queries as a feature of GraphQL::Pro, which it sells separately on top of the GraphQL runtime. It is not presented as part of the free gem.

What are the disadvantages of GraphQL?

This article covers graphql-ruby's own boundaries rather than GraphQL's general disadvantages: the schema lives in Ruby code rather than a standalone schema file, and persisted queries, API versioning, streaming payloads, server-side caching and rate limiters are Pro features.

Is GraphQL just JSON?

The README does not address this. It describes graphql-ruby as an implementation of the GraphQL specification with a Ruby object graph of types, fields and resolvers, and does not discuss the wire format.

Official sources

  1. License: MIT
  2. Project website
  3. README
  4. Releases
  5. rmosolgo/graphql-ruby on GitHub
Add this badge to your README

If you maintain this project, the badge below links readers to this analysis and shows its maintenance status from the daily GitHub snapshot. Paste the markdown into your README; add ?metric=license or ?metric=stars to the image URL for a different field.

Add this badge to your README

markdown
[![Hysen Labs](https://hysenlabs.com/badge/rmosolgo-graphql-ruby.svg)](https://hysenlabs.com/projects/rmosolgo-graphql-ruby)