From 0311433f0313a01fd7ef671730f2c63ba9317fca Mon Sep 17 00:00:00 2001 From: kamila-brylewska-zendesk Date: Thu, 19 Dec 2024 16:17:19 +0100 Subject: [PATCH] feat: Add request param to didEncounter method (#3194) This PR enhances didEncounterError method in RemoteGraphQLDataSource class. Co-authored-by: Chris Lenfest --- .changeset/warm-moles-jog.md | 5 +++++ gateway-js/src/datasources/RemoteGraphQLDataSource.ts | 3 ++- 2 files changed, 7 insertions(+), 1 deletion(-) create mode 100644 .changeset/warm-moles-jog.md diff --git a/.changeset/warm-moles-jog.md b/.changeset/warm-moles-jog.md new file mode 100644 index 000000000..785fbdcd5 --- /dev/null +++ b/.changeset/warm-moles-jog.md @@ -0,0 +1,5 @@ +--- +"@apollo/gateway": minor +--- + +Add request parameter to didEncounterError method diff --git a/gateway-js/src/datasources/RemoteGraphQLDataSource.ts b/gateway-js/src/datasources/RemoteGraphQLDataSource.ts index f52005e31..962fd1196 100644 --- a/gateway-js/src/datasources/RemoteGraphQLDataSource.ts +++ b/gateway-js/src/datasources/RemoteGraphQLDataSource.ts @@ -220,7 +220,7 @@ export class RemoteGraphQLDataSource< http: fetchResponse, }; } catch (error) { - this.didEncounterError(error, fetchRequest, fetchResponse, context); + this.didEncounterError(error, fetchRequest, fetchResponse, context, request); throw error; } } @@ -284,6 +284,7 @@ export class RemoteGraphQLDataSource< _fetchRequest: NodeFetchRequest, _fetchResponse?: FetcherResponse, _context?: TContext, + _request?: GatewayGraphQLRequest, ) { throw error; }