Skip to content

Support configuration options for GraphQLHttpClient #35

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

jballe
Copy link
Contributor

@jballe jballe commented Apr 14, 2025

Use SitecoreGraphQlClientOptions for GraphQLHttpClient and support Configure

Description / Motivation

With this change it is possible to configure the GraphQLClient with Configure in DependencyInjection.

e.g. in a WebApplicationFactory call services.Configure<SitecoreGraphQlClientOptions>(cfg => cfg.HttpMessageHandler = _mockClientHandler);

The value is already consumed through dependency injection in eg. GraphQlSiteInfoService

The consequence is that any validation error are thrown upon first time the GraphQLHttpClient is resolved instead of on initial call to AddGraphQlClient during application setup.

Testing

  • The Unit & Intergration tests are passing.
  • I have added the necessary tests to cover my changes.

Terms

@jballe
Copy link
Contributor Author

jballe commented Apr 24, 2025

I have added a sample implementation using this configure feature at https://github.com/jballe/Sitecore-ASP.NET-SDK-IntegrationTest

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant