Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
24 lines (18 sloc) 416 Bytes
# frozen_string_literal: true
require 'json'
require_relative 'app/graphql/schema'
def request(event:, context:)
puts "Received Request: #{event}"
body = Schema.execute(event['body']).to_json
{
statusCode: 200,
body: body
}
rescue StandardError => e
puts e.message
puts e.backtrace.inspect
{
statusCode: 400,
body: JSON.generate('Bad request, please POST a request body!')
}
end
You can’t perform that action at this time.