graphql-client icon indicating copy to clipboard operation
graphql-client copied to clipboard

Support for Middleware?

Open aergonaut opened this issue 7 years ago • 2 comments

Is there any idea for adding middleware to the client? I think it would be interesting, for example, to support query caching, retries, logging, etc.

aergonaut avatar Aug 08 '18 22:08 aergonaut

Couldn’t you do that with a custom HTTP client layer, the same way you have to do with authentication (especially to something like AWS AppSync using Cognito IDP)?

halostatue avatar Aug 10 '18 02:08 halostatue

That's a good point. I hadn't thought of making a custom network layer instead, but yes, a custom network adapter could also handle inserting middleware/etc. Maybe the project should have more docs on how to make custom network adapters.

aergonaut avatar Aug 10 '18 19:08 aergonaut