Skip to content

Commit 11ef41a

Browse files
committed
Add more debug log to ensure graphQL error
1 parent 9812295 commit 11ef41a

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

lib/interscript-api/lambda_function.rb

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ def handler(event:, context: {})
1919

2020
body = event['body']
2121
if "OPTIONS".casecmp?(event['httpMethod']) || body.nil? || body.empty?
22+
puts "123 7"
2223
return {
2324
statusCode: 200,
2425
headers: headers,
@@ -28,13 +29,15 @@ def handler(event:, context: {})
2829
query = begin
2930
JSON.parse(body)["query"]
3031
rescue JSON::ParserError
32+
puts "123 5"
3133
body
3234
end
3335

3436
status_code = begin
3537
result = InterscriptApi::Schema.execute(query).to_json
3638
200
3739
rescue StandardError => e
40+
puts "123 4"
3841
result = e.message
3942
400
4043
end
@@ -43,6 +46,7 @@ def handler(event:, context: {})
4346
result_json = JSON.parse result
4447
status_code = 400 if result_json.key?("errors")
4548
rescue JSON::ParserError
49+
puts "123 6"
4650
#ignore
4751
end
4852

0 commit comments

Comments
 (0)