Skip to content

Commit

Permalink
feat: Add request param to didEncounter method (#3194)
Browse files Browse the repository at this point in the history
This PR enhances didEncounterError method in
RemoteGraphQLDataSource class.

Co-authored-by: Chris Lenfest <clenfest@apollographql.com>
  • Loading branch information
kamila-brylewska-zendesk and clenfest authored Dec 19, 2024
1 parent febbecd commit 0311433
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/warm-moles-jog.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@apollo/gateway": minor
---

Add request parameter to didEncounterError method
3 changes: 2 additions & 1 deletion gateway-js/src/datasources/RemoteGraphQLDataSource.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}
Expand Down Expand Up @@ -284,6 +284,7 @@ export class RemoteGraphQLDataSource<
_fetchRequest: NodeFetchRequest,
_fetchResponse?: FetcherResponse,
_context?: TContext,
_request?: GatewayGraphQLRequest,
) {
throw error;
}
Expand Down

0 comments on commit 0311433

Please sign in to comment.