Skip to content

Modify many handlers at once? #753

Answered by kettanaito
Geddard asked this question in Q&A
Discussion options

You must be logged in to vote

Hey, @Geddard. Thanks for reaching out.

Take a look at the updated Custom response composition recipe. It features a globally defined delay set on all mocked responses.

You can transform handlers as you wish, just be careful not to dive too deep into the internals.

Does this make sense? or is it too late to modify the handlers at that point?

Response transformations are bound to the resolver function. Once you've called rest[method]/graphql[method], the resolver's logic is hoisted under the returned RequestHandler instance:

protected resolver: ResponseResolver<any, any>

I wouldn't recommend modifying these instances…

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@Geddard
Comment options

@kettanaito
Comment options

@Geddard
Comment options

Answer selected by kettanaito
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants