From 473a772032889d5e4a048fb97321a7e1d8ddc2cd Mon Sep 17 00:00:00 2001 From: Paul Chavard Date: Fri, 28 Oct 2022 12:15:55 +0200 Subject: [PATCH] feat(graphql): on api exceptions log query and variables --- app/controllers/api/v2/graphql_controller.rb | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/app/controllers/api/v2/graphql_controller.rb b/app/controllers/api/v2/graphql_controller.rb index 11a5ce654..1f3de6458 100644 --- a/app/controllers/api/v2/graphql_controller.rb +++ b/app/controllers/api/v2/graphql_controller.rb @@ -82,7 +82,11 @@ class API::V2::GraphqlController < API::V2::BaseController def handle_error_in_production(exception) id = SecureRandom.uuid - Sentry.capture_exception(exception, extra: { exception_id: id }) + Sentry.capture_exception(exception, extra: { + exception_id: id, + query: params[:query], + variables: params[:variables].to_json + }) render json: { errors: [