graphql-on-rails

A simple implementation of GraphQL in Ruby on Rails, to use like a boilerplate.

Stars
4

GraphQL on Rails

This is a implementation of the tutorial How to GraphQL with improvements in architecture.

Installation

Install dependencies:

bundle install

rails db:create
rails db:migrate
rails db:seed

Starting the server:

rails s

Opening the application:

open http://localhost:3000/

Opening GraphQL playground:

open http://localhost:3000/graphiql

Sample GraphQL Queries and mutation

List all links:

{
  allLinks {
    id
    url
    description
  }
}

Creates new link:

mutation {
  createLink(url:"http://example.com", description:"Example") {
    id
    url
    description
  }
}