You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
But since RequestOptions doesn't include either the request path or url, we don't have access to the entire request info that was sent. The path/url would be useful for logging and debugging potential failures.
NOTE: In the old apollo-datasource-rest implementation, Request was passed in as an argument instead of RequestOptions which included the url field:
Update the RESTDataSource.didEncounterError() function to include an url argument:
protected didEncounterError(_error: Error, _url: string, _request: RequestOptions) {
// left as a no-op instead of an unimplemented optional method to avoid
// breaking an existing use case where one calls
// `super.didEncounterErrors(...)` This could be unimplemented / undefined
// in a theoretical next major of this package.
}
Which is also consistent with the arguments passed into the RESTDataSource.cacheOptionsFor() function.
The text was updated successfully, but these errors were encountered:
Problem:
Currently, the
RESTDataSource.didEncounterError()
function accepts the error and request options argument: https://github.com/apollographql/datasource-rest/blob/main/src/RESTDataSource.ts#L264C3-L269C4But since
RequestOptions
doesn't include either the request path or url, we don't have access to the entire request info that was sent. The path/url would be useful for logging and debugging potential failures.NOTE: In the old
apollo-datasource-rest
implementation,Request
was passed in as an argument instead ofRequestOptions
which included theurl
field:Proposal:
Update the
RESTDataSource.didEncounterError()
function to include anurl
argument:Which is also consistent with the arguments passed into the
RESTDataSource.cacheOptionsFor()
function.The text was updated successfully, but these errors were encountered: