Skip to content

Instantly share code, notes, and snippets.

@hash32bot
Created December 25, 2018 13:27
Show Gist options
  • Save hash32bot/88b8bb5a79481dd55f677e5fce3d892e to your computer and use it in GitHub Desktop.
Save hash32bot/88b8bb5a79481dd55f677e5fce3d892e to your computer and use it in GitHub Desktop.
Root Query - Sinatra App http://bit.ly/2V9p6OL
require 'graphql'
require_relative 'types/speaker'
class QueryType < GraphQL::Schema::Object
description "The query root of this schema"
field :speakers, [Types::Speaker], null: false do
description 'Get all speakers of the system'
end
def speakers
Speaker.all
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment