graphql-dotnet / graphql-client

A GraphQL Client for .NET Standard
MIT License
623 stars 132 forks source link

How to use Polly with this library? #617

Open endeffects opened 8 months ago

endeffects commented 8 months ago

I'd like to use polly to implement retries for failed requests that return a Too Many Requests status code. Is there any sample available or base class where i can access the used http client?

Just to be sure, i'm not talking about wrapping the graphQl client calls, i'd like to know if there is a proper way to inject polly into the existing pipeline.

richardaubin commented 8 months ago

Use DI and inject an httpclient into the graphqlhttpclient. You can configure your httpclient with your polly requirements.

olops2000 commented 1 week ago

I also have this requirement and the solution is not obvious to me. Sample code anyone? Ta.

I am generally struggling with this library with lack of example code.