Step by step tutorial to write a graphql server in sinatra (ruby)
Branch: master
Clone or download
awinabi Merge pull request #1 from awinabi/class-based-api
Migrate to new class-based API syntax
Latest commit 2f9eedf Dec 26, 2018
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
config Add activerecord database connection config file Feb 23, 2018
db Speaker fields and run migrations Feb 23, 2018
graphql Migrate to new class-based API syntax Dec 25, 2018
models
.gitignore
Gemfile Migrate to new class-based API syntax Dec 25, 2018
Gemfile.lock Migrate to new class-based API syntax Dec 25, 2018
README.md Update README Dec 19, 2018
Rakefile
app.rb Add /graphql POST endpoint Feb 24, 2018
config.ru

README.md

GraphQL server with Sinatra (Ruby)

A step by step tutorial to write a graphql server in sinatra (ruby), using the graphql gem.

Steps

  • STEP 1: Create a Sinatra application
  • STEP 2: Add JSON responses
  • STEP 3: Add database connections and models with ActiveRecord
  • STEP 4: Add graphql and define a query to list speakers
  • STEP 5: Adding a Mutation root type
  • STEP 6: Define a Mutation for speaker creation

Read more at Medium

Part 1 - Sinatra Setup and Querying

Part 2 - Mutations