Allow consuming the return of "ctx.fetch" as a mocked response #1144
kettanaito
started this conversation in
RFC
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Is your feature request related to a problem? Please describe.
Currently, if you wish to proxy a request and use some other response as the mocked response you'd have to construct the response composition chain manually, which is tedious and at times impossible without external utilities (like
headers-utils
):Describe the solution you'd like
I'd like to have an opportunity to return whichever response I get from
ctx.fetch
from my resolver, so it could be used as a mocked response.I'd still like to preserve the return type of
ctx.fetch
beingResponse
, because it's familiar and standardized. Perhaps there can be a new API/extension that'd coerceResponse
toResponseComposition
or an input to it.Describe alternatives you've considered
Manual response composition is the only current alternative.
Beta Was this translation helpful? Give feedback.
All reactions