Created
December 25, 2018 13:30
-
-
Save hash32bot/c0debd10ebdd695f806ec9455b477374 to your computer and use it in GitHub Desktop.
app.rb changes - Graphql Sinatra - http://bit.ly/2V9p6OL
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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