From 2655467945cacb74d63705725f98780e290f2a83 Mon Sep 17 00:00:00 2001 From: Mounir Dhahri Date: Tue, 10 Oct 2023 18:46:20 +0200 Subject: [PATCH] fix: return query name in Sentry (#9399) fix: return query name --- .../middlewares/principalFieldErrorHandlerMiddleware.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/app/system/relay/middlewares/principalFieldErrorHandlerMiddleware.ts b/src/app/system/relay/middlewares/principalFieldErrorHandlerMiddleware.ts index 6a4c6f8198e..44e067e897d 100644 --- a/src/app/system/relay/middlewares/principalFieldErrorHandlerMiddleware.ts +++ b/src/app/system/relay/middlewares/principalFieldErrorHandlerMiddleware.ts @@ -19,12 +19,12 @@ export const principalFieldErrorHandlerMiddleware = async ( // query did not have a principal field, but experienced an error, we report it to sentry and volley if (!requestHasPrincipalField && !!res?.errors?.length) { - trackError(req.operation.operationKind, req.operation.operationKind, "default") - captureMessage(`${req.operation.operationKind} failed: ${req.operation.operationKind}`, "log") + trackError(req.operation.name, req.operation.operationKind, "default") + captureMessage(`${req.operation.operationKind} failed: ${req.operation.name}`, "log") } if (principalFieldWasInvolvedInError) { - trackError(req.operation.operationKind, req.operation.operationKind, "principalField") + trackError(req.operation.name, req.operation.operationKind, "principalField") return throwError(req, res) } else { return res