We have a practice of wrapping HTTP calls to other internal services in Circuit Breakers. This is very easy to do with HTTPLink since it takes a fetch function as an option. However, looking into using DataSources there doesn't seem to be any way of achieving something equivalent with RESTDataSource. The call to fetch happens inside the HTTPCache class which always imports the same global fetch function.
It would be really helpful not only for implementing circuit breakers but I'm sure other specifics to be able to configure RESTDataSource with a custom fetch function.
We have a practice of wrapping HTTP calls to other internal services in Circuit Breakers. This is very easy to do with
HTTPLinksince it takes a fetch function as an option. However, looking into using DataSources there doesn't seem to be any way of achieving something equivalent withRESTDataSource. The call to fetch happens inside theHTTPCacheclass which always imports the same globalfetchfunction.It would be really helpful not only for implementing circuit breakers but I'm sure other specifics to be able to configure
RESTDataSourcewith a customfetchfunction.