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; }