Support configuration options for GraphQLHttpClient#35
Support configuration options for GraphQLHttpClient#35jballe wants to merge 2 commits intoSitecore:mainfrom
Conversation
|
I have added a sample implementation using this configure feature at https://github.com/jballe/Sitecore-ASP.NET-SDK-IntegrationTest |
Could you explain why this is desirable? I might be misunderstanding but doesn't this mean that a misconfiguration of the application is simply detectable much later rather than sooner? |
|
This old PR is probably deprecated now, so maybe just close it, that is not what need focus in this project. However.... I blogged about using it for IntegrationTesting at https://balle.dev/posts/sitecore-xm-aspnet-integration-tests/ |
Use SitecoreGraphQlClientOptions for GraphQLHttpClient and support Configure
Description / Motivation
With this change it is possible to configure the
GraphQLClientwith Configure in DependencyInjection.e.g. in a
WebApplicationFactorycallservices.Configure<SitecoreGraphQlClientOptions>(cfg => cfg.HttpMessageHandler = _mockClientHandler);The value is already consumed through dependency injection in eg.
GraphQlSiteInfoServiceThe consequence is that any validation error are thrown upon first time the
GraphQLHttpClientis resolved instead of on initial call toAddGraphQlClientduring application setup.Testing
Terms