Skip to content

Instantly share code, notes, and snippets.

@hash32bot
Created December 25, 2018 13:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hash32bot/c0debd10ebdd695f806ec9455b477374 to your computer and use it in GitHub Desktop.
Save hash32bot/c0debd10ebdd695f806ec9455b477374 to your computer and use it in GitHub Desktop.
app.rb changes - Graphql Sinatra - http://bit.ly/2V9p6OL
# Changes to file app.rb
# ...
require 'rack/contrib'
class ConferenceApp < Sinatra::Base
# ...
use Rack::PostBodyContentTypeParser
# ...
# ...
post '/graphql' do
result = ConferenceAppSchema.execute(
params[:query],
variables: params[:variables],
context: { current_user: nil },
)
json result
end
# ...
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment