Skip to content

Allow RESTDataSource to use a custom fetch function #140

@jbachhardie

Description

@jbachhardie

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.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions