Convention over Configuration
Define a resource class with a simple DSL and Quail auto-generates GraphQL types, queries, mutations, and subscriptions from your ActiveRecord models.
Convention over Configuration
Define a resource class with a simple DSL and Quail auto-generates GraphQL types, queries, mutations, and subscriptions from your ActiveRecord models.
Turbo streamed GraphQL Subscriptions
Declare subscribe_on in a resource and Quail wires up GraphQL subscriptions powered by Rails ActionCable.
Rails-native Tooling
Generators, rake tasks, Railtie integration, and patterns that feel like home. Your models stay clean; the GraphQL layer lives in its own space.
AGENTS.md Ready
Documentation ships with llms.txt support, making it easy for AI coding agents to read and understand Quail without any extra effort.
Install Quail and scaffold your GraphQL layer
rails generate quail:installThis creates:
app/├── channels/│ └── graphql_channel.rb # ActionCable for subscriptions├── controllers/│ └── graphql_controller.rb # Ready-to-go controller└── graphql/ ├── app_schema.rb # Your GraphQL schema ├── mutations/ # Custom mutation classes ├── queries/ # Custom query resolvers ├── resources/ # Where your resource files live ├── subscriptions/ # Custom subscription classes └── types/ # Custom GraphQL typesconfig/└── initializers/ └── quail.rb # ConfigurationCreate a model and generate its resource
rails g model Article title:string body:text published_at:datetime author:referencesrails db:migraterails generate quail:resource ArticleDefine what to expose in the resource
class ArticleResource include Quail::Resource # Activates the DSL and registers this resource
# Expose these columns as GraphQL fields attributes :id, :title, :body, :published_at
# Wire up associations — types resolve automatically has_many :comments belongs_to :author
# Only these fields are accepted in create/update mutations writable_attributes :title, :body
# Push real-time updates over ActionCable subscribe_on :create, :updateendDump the schema to see what Quail generated
rails quail:dumptype Article { id: ID! title: String! body: String! publishedAt: ISO8601DateTime comments: [Comment!]! author: Author!}
type ArticleConnection { edges: [ArticleEdge!]! nodes: [Article!]! pageInfo: PageInfo!}
type Query { article(id: ID!): Article articles(first: Int, after: String, last: Int, before: String): ArticleConnection!}
type Mutation { articleCreate(input: ArticleCreateInput!): Article articleUpdate(input: ArticleUpdateInput!): Article articleDelete(input: ArticleDeleteInput!): Article}
type Subscription { articleCreated: Article! articleUpdated: Article!}query { articles(first: 5) { edges { node { id title author { name } } } pageInfo { hasNextPage endCursor } }}mutation { articleCreate(input: { title: "Hello Quail", body: "GraphQL made easy." }) { id title createdAt }}One resource file. Full CRUD, pagination, and real-time subscriptions — no boilerplate.