diff --git a/GraphHealthChecks.Tests/GraphHealthChecks.Tests.csproj b/GraphHealthChecks.Tests/GraphHealthChecks.Tests.csproj index fd17202..e2e0eb3 100644 --- a/GraphHealthChecks.Tests/GraphHealthChecks.Tests.csproj +++ b/GraphHealthChecks.Tests/GraphHealthChecks.Tests.csproj @@ -9,8 +9,8 @@ - - + + diff --git a/GraphHealthChecks.Tests/GraphHealthChecksFactoriesTests.cs b/GraphHealthChecks.Tests/GraphHealthChecksFactoriesTests.cs index 63bc470..54c6fc7 100644 --- a/GraphHealthChecks.Tests/GraphHealthChecksFactoriesTests.cs +++ b/GraphHealthChecks.Tests/GraphHealthChecksFactoriesTests.cs @@ -98,6 +98,100 @@ public void GraphHealthCheckFactoryWithLoggerFnDefaultSchema() Assert.Null((result as GraphHealthCheck)?.Schema); } + [Fact(DisplayName = "GraphHealthChecksFactories - GraphHealthCheckFactoryUsingProviderWithNoLogger - Custom Schema")] + public void GraphHealthCheckFactoryUsingProviderWithNoLoggerCustomSchema() + { + var result = GraphHealthChecksFactories.GraphHealthCheckFactoryUsingProviderWithNoLogger("schema")( + new ServiceCollection() + .AddGraphQLServer() + .AddQueryType() + .Services + .BuildServiceProvider() + ); + + Assert.IsType(result, exactMatch: false); + Assert.Equal("schema", (result as GraphHealthCheck)?.Schema); + } + + [Fact(DisplayName = "GraphHealthChecksFactories - GraphHealthCheckFactoryUsingProviderWithNoLogger - Default Schema")] + public void GraphHealthCheckFactoryUsingProviderWithNoLoggerDefaultSchema() + { + var result = GraphHealthChecksFactories.GraphHealthCheckFactoryUsingProviderWithNoLogger()( + new ServiceCollection() + .AddGraphQLServer() + .AddQueryType() + .Services + .BuildServiceProvider() + ); + + Assert.IsType(result, exactMatch: false); + Assert.Null((result as GraphHealthCheck)?.Schema); + } + + [Fact(DisplayName = "GraphHealthChecksFactories - GraphHealthCheckFactoryUsingProviderWithILogger - Custom Schema")] + public void GraphHealthCheckFactoryUsingProviderWithILoggerCustomSchema() + { + var result = GraphHealthChecksFactories.GraphHealthCheckFactoryUsingProviderWithILogger("schema")( + new ServiceCollection() + .AddLogging() + .AddGraphQLServer() + .AddQueryType() + .Services + .BuildServiceProvider() + ); + + Assert.IsType(result, exactMatch: false); + Assert.Equal("schema", (result as GraphHealthCheck)?.Schema); + } + + [Fact(DisplayName = "GraphHealthChecksFactories - GraphHealthCheckFactoryUsingProviderWithILogger - Default Schema")] + public void GraphHealthCheckFactoryUsingProviderWithILoggerDefaultSchema() + { + var result = GraphHealthChecksFactories.GraphHealthCheckFactoryUsingProviderWithILogger()( + new ServiceCollection() + .AddLogging() + .AddGraphQLServer() + .AddQueryType() + .Services + .BuildServiceProvider() + ); + + Assert.IsType(result, exactMatch: false); + Assert.Null((result as GraphHealthCheck)?.Schema); + } + + [Fact(DisplayName = "GraphHealthChecksFactories - GraphHealthCheckFactoryUsingProviderWithLoggerFn - Custom Schema")] + public void GraphHealthCheckFactoryUsingProviderWithLoggerFnCustomSchema() + { + var result = GraphHealthChecksFactories.GraphHealthCheckFactoryUsingProviderWithILoggerFactory("schema")( + new ServiceCollection() + .AddLogging() + .AddGraphQLServer() + .AddQueryType() + .Services + .BuildServiceProvider() + ); + + Assert.IsType(result, exactMatch: false); + Assert.Equal("schema", (result as GraphHealthCheck)?.Schema); + } + + [Fact(DisplayName = "GraphHealthChecksFactories - GraphHealthCheckFactoryUsingProviderWithLoggerFn - Default Schema")] + public void GraphHealthCheckFactoryUsingProviderWithLoggerFnDefaultSchema() + { + var result = GraphHealthChecksFactories.GraphHealthCheckFactoryUsingProviderWithILoggerFactory()( + new ServiceCollection() + .AddLogging() + .AddGraphQLServer() + .AddQueryType() + .Services + .BuildServiceProvider() + ); + + Assert.IsType(result, exactMatch: false); + Assert.Null((result as GraphHealthCheck)?.Schema); + } + public class Query { public string Name => "Hello"; diff --git a/GraphHealthChecks.Tests/GraphHealthExtensionsTests.cs b/GraphHealthChecks.Tests/GraphHealthExtensionsTests.cs index 9bbc093..bc0e99e 100644 --- a/GraphHealthChecks.Tests/GraphHealthExtensionsTests.cs +++ b/GraphHealthChecks.Tests/GraphHealthExtensionsTests.cs @@ -15,9 +15,11 @@ public class GraphHealthExtensionsTests "health5", "health6" ]; + private static readonly string[] _defaultHealthNames = ["Graph Health"]; + private static readonly string[] _customHealthNames = ["Graph"]; [Fact(DisplayName = "AddGraphHealth - Multiple Instances - Separate Names and Schemas")] - public void MultipleInstancesSeparateNamesAndSchemas() + public void AddGraphHealthMultipleInstancesSeparateNamesAndSchemas() { var options = new ServiceCollection() @@ -44,7 +46,7 @@ public void MultipleInstancesSeparateNamesAndSchemas() } [Fact(DisplayName = "AddGraphHealth - Multiple Instances - Separate Names and Same Schema")] - public void MultipleInstancesSeparateNamesAndSameSchema() + public void AddGraphHealthMultipleInstancesSeparateNamesAndSameSchema() { var options = new ServiceCollection() @@ -71,7 +73,7 @@ public void MultipleInstancesSeparateNamesAndSameSchema() } [Fact(DisplayName = "AddGraphHealth - Multiple Instances - Separate Names and Same Schema (Default)")] - public void MultipleInstancesSeparateNamesAndSameSchemaDefault() + public void AddGraphHealthMultipleInstancesSeparateNamesAndSameSchemaDefault() { var options = new ServiceCollection() @@ -98,7 +100,7 @@ public void MultipleInstancesSeparateNamesAndSameSchemaDefault() } [Fact(DisplayName = "AddGraphHealth - Multiple Instances - Same Name and Schema (Default)")] - public void MultipleInstancesSameNameAndSchema() + public void AddGraphHealthMultipleInstancesSameNameAndSchema() { var options = new ServiceCollection() @@ -125,7 +127,7 @@ public void MultipleInstancesSameNameAndSchema() } [Fact(DisplayName = "AddGraphHealth - Multiple Instances - Same Name (Default) and Schema (Default)")] - public void MultipleInstancesSameNameDefaultAndSchemaDefault() + public void AddGraphHealthMultipleInstancesSameNameDefaultAndSchemaDefault() { var options = new ServiceCollection() @@ -146,7 +148,7 @@ public void MultipleInstancesSameNameDefaultAndSchemaDefault() options.Registrations.Select(x => x.Name), n => { - if (n != "Graph Health") throw new Exception("Does not match"); + if (n != _defaultHealthNames[0]) throw new Exception("Does not match"); } ); } @@ -165,7 +167,7 @@ public void AddGraphHealthWithNoLoggerDefaultHealthName() Assert.Equal( options.Registrations.Count, - new[] { "Graph Health" } + _defaultHealthNames .Intersect(options.Registrations.Select(x => x.Name)) .Distinct() .Count() @@ -178,7 +180,7 @@ public void AddGraphHealthWithNoLoggerCustomHealthName() var options = new ServiceCollection() .AddHealthChecks() - .AddGraphHealthWithNoLogger("Graph") + .AddGraphHealthWithNoLogger(_customHealthNames[0]) .Services .BuildServiceProvider() .GetRequiredService>() @@ -186,7 +188,7 @@ public void AddGraphHealthWithNoLoggerCustomHealthName() Assert.Equal( options.Registrations.Count, - new[] { "Graph" } + _customHealthNames .Intersect(options.Registrations.Select(x => x.Name)) .Distinct() .Count() @@ -208,7 +210,7 @@ public void AddGraphHealthWithILoggerDefaultHealthName() Assert.Equal( options.Registrations.Count, - new[] { "Graph Health" } + _defaultHealthNames .Intersect(options.Registrations.Select(x => x.Name)) .Distinct() .Count() @@ -222,7 +224,7 @@ public void AddGraphHealthWithILoggerCustomHealthName() new ServiceCollection() .AddLogging() .AddHealthChecks() - .AddGraphHealthWithILogger("Graph") + .AddGraphHealthWithILogger(_customHealthNames[0]) .Services .BuildServiceProvider() .GetRequiredService>() @@ -230,7 +232,7 @@ public void AddGraphHealthWithILoggerCustomHealthName() Assert.Equal( options.Registrations.Count, - new[] { "Graph" } + _customHealthNames .Intersect(options.Registrations.Select(x => x.Name)) .Distinct() .Count() @@ -252,7 +254,7 @@ public void AddGraphHealthWithILoggerFactoryDefaultHealthName() Assert.Equal( options.Registrations.Count, - new[] { "Graph Health" } + _defaultHealthNames .Intersect(options.Registrations.Select(x => x.Name)) .Distinct() .Count() @@ -266,7 +268,7 @@ public void AddGraphHealthWithILoggerFactoryCustomHealthName() new ServiceCollection() .AddLogging() .AddHealthChecks() - .AddGraphHealthWithILoggerFactory("Graph") + .AddGraphHealthWithILoggerFactory(_customHealthNames[0]) .Services .BuildServiceProvider() .GetRequiredService>() @@ -274,7 +276,272 @@ public void AddGraphHealthWithILoggerFactoryCustomHealthName() Assert.Equal( options.Registrations.Count, - new[] { "Graph" } + _customHealthNames + .Intersect(options.Registrations.Select(x => x.Name)) + .Distinct() + .Count() + ); + } + + [Fact(DisplayName = "AddGraphHealthUsingProvider - Multiple Instances - Separate Names and Schemas")] + public void AddGraphHealthUsingProviderMultipleInstancesSeparateNamesAndSchemas() + { + var options = + new ServiceCollection() + .AddLogging() + .AddHealthChecks() + .AddGraphHealthUsingProviderWithNoLogger("health1", "schema1") + .AddGraphHealthUsingProviderWithNoLogger("health2", "schema2") + .AddGraphHealthUsingProviderWithILogger("health3", "schema3") + .AddGraphHealthUsingProviderWithILogger("health4", "schema4") + .AddGraphHealthUsingProviderWithILoggerFactory("health5", "schema5") + .AddGraphHealthUsingProviderWithILoggerFactory("health6", "schema6") + .Services + .BuildServiceProvider() + .GetRequiredService>() + .Value; + + Assert.Equal( + options.Registrations.Count, + _schemas + .Intersect(options.Registrations.Select(x => x.Name)) + .Distinct() + .Count() + ); + } + + [Fact(DisplayName = "AddGraphHealthUsingProvider - Multiple Instances - Separate Names and Same Schema")] + public void AddGraphHealthUsingProviderMultipleInstancesSeparateNamesAndSameSchema() + { + var options = + new ServiceCollection() + .AddLogging() + .AddHealthChecks() + .AddGraphHealthUsingProviderWithNoLogger("health1", "schema") + .AddGraphHealthUsingProviderWithNoLogger("health2", "schema") + .AddGraphHealthUsingProviderWithILogger("health3", "schema") + .AddGraphHealthUsingProviderWithILogger("health4", "schema") + .AddGraphHealthUsingProviderWithILoggerFactory("health5", "schema") + .AddGraphHealthUsingProviderWithILoggerFactory("health6", "schema") + .Services + .BuildServiceProvider() + .GetRequiredService>() + .Value; + + Assert.Equal( + options.Registrations.Count, + _schemas + .Intersect(options.Registrations.Select(x => x.Name)) + .Distinct() + .Count() + ); + } + + [Fact(DisplayName = "AddGraphHealthUsingProvider - Multiple Instances - Separate Names and Same Schema (Default)")] + public void AddGraphHealthUsingProviderMultipleInstancesSeparateNamesAndSameSchemaDefault() + { + var options = + new ServiceCollection() + .AddLogging() + .AddHealthChecks() + .AddGraphHealthUsingProviderWithNoLogger("health1") + .AddGraphHealthUsingProviderWithNoLogger("health2") + .AddGraphHealthUsingProviderWithILogger("health3") + .AddGraphHealthUsingProviderWithILogger("health4") + .AddGraphHealthUsingProviderWithILoggerFactory("health5") + .AddGraphHealthUsingProviderWithILoggerFactory("health6") + .Services + .BuildServiceProvider() + .GetRequiredService>() + .Value; + + Assert.Equal( + options.Registrations.Count, + _schemas + .Intersect(options.Registrations.Select(x => x.Name)) + .Distinct() + .Count() + ); + } + + [Fact(DisplayName = "AddGraphHealthUsingProvider - Multiple Instances - Same Name and Schema (Default)")] + public void AddGraphHealthUsingProviderMultipleInstancesSameNameAndSchema() + { + var options = + new ServiceCollection() + .AddLogging() + .AddHealthChecks() + .AddGraphHealthUsingProviderWithNoLogger("health") + .AddGraphHealthUsingProviderWithNoLogger("health") + .AddGraphHealthUsingProviderWithILogger("health") + .AddGraphHealthUsingProviderWithILogger("health") + .AddGraphHealthUsingProviderWithILoggerFactory("health") + .AddGraphHealthUsingProviderWithILoggerFactory("health") + .Services + .BuildServiceProvider() + .GetRequiredService>() + .Value; + + Assert.All( + options.Registrations.Select(x => x.Name), + n => + { + if (n != "health") throw new Exception("Does not match"); + } + ); + } + + [Fact(DisplayName = "AddGraphHealthUsingProvider - Multiple Instances - Same Name (Default) and Schema (Default)")] + public void AddGraphHealthUsingProviderMultipleInstancesSameNameDefaultAndSchemaDefault() + { + var options = + new ServiceCollection() + .AddLogging() + .AddHealthChecks() + .AddGraphHealthUsingProviderWithNoLogger() + .AddGraphHealthUsingProviderWithNoLogger() + .AddGraphHealthUsingProviderWithILogger() + .AddGraphHealthUsingProviderWithILogger() + .AddGraphHealthUsingProviderWithILoggerFactory() + .AddGraphHealthUsingProviderWithILoggerFactory() + .Services + .BuildServiceProvider() + .GetRequiredService>() + .Value; + + Assert.All( + options.Registrations.Select(x => x.Name), + n => + { + if (n != _defaultHealthNames[0]) throw new Exception("Does not match"); + } + ); + } + + [Fact(DisplayName = "AddGraphHealthUsingProviderWithNoLogger - Default Health Name")] + public void AddGraphHealthUsingProviderWithNoLoggerDefaultHealthName() + { + var options = + new ServiceCollection() + .AddHealthChecks() + .AddGraphHealthUsingProviderWithNoLogger() + .Services + .BuildServiceProvider() + .GetRequiredService>() + .Value; + + Assert.Equal( + options.Registrations.Count, + _defaultHealthNames + .Intersect(options.Registrations.Select(x => x.Name)) + .Distinct() + .Count() + ); + } + + [Fact(DisplayName = "AddGraphHealthUsingProviderWithNoLogger - Custom Health Name")] + public void AddGraphHealthUsingProviderWithNoLoggerCustomHealthName() + { + var options = + new ServiceCollection() + .AddHealthChecks() + .AddGraphHealthUsingProviderWithNoLogger(_customHealthNames[0]) + .Services + .BuildServiceProvider() + .GetRequiredService>() + .Value; + + Assert.Equal( + options.Registrations.Count, + _customHealthNames + .Intersect(options.Registrations.Select(x => x.Name)) + .Distinct() + .Count() + ); + } + + [Fact(DisplayName = "AddGraphHealthUsingProviderWithILogger - Default Health Name")] + public void AddGraphHealthUsingProviderWithILoggerDefaultHealthName() + { + var options = + new ServiceCollection() + .AddLogging() + .AddHealthChecks() + .AddGraphHealthUsingProviderWithILogger() + .Services + .BuildServiceProvider() + .GetRequiredService>() + .Value; + + Assert.Equal( + options.Registrations.Count, + _defaultHealthNames + .Intersect(options.Registrations.Select(x => x.Name)) + .Distinct() + .Count() + ); + } + + [Fact(DisplayName = "AddGraphHealthUsingProviderWithILogger - Custom Health Name")] + public void AddGraphHealthUsingProviderWithILoggerCustomHealthName() + { + var options = + new ServiceCollection() + .AddLogging() + .AddHealthChecks() + .AddGraphHealthUsingProviderWithILogger(_customHealthNames[0]) + .Services + .BuildServiceProvider() + .GetRequiredService>() + .Value; + + Assert.Equal( + options.Registrations.Count, + _customHealthNames + .Intersect(options.Registrations.Select(x => x.Name)) + .Distinct() + .Count() + ); + } + + [Fact(DisplayName = "AddGraphHealthUsingProviderWithILoggerFactory - Default Health Name")] + public void AddGraphHealthUsingProviderWithILoggerFactoryDefaultHealthName() + { + var options = + new ServiceCollection() + .AddLogging() + .AddHealthChecks() + .AddGraphHealthUsingProviderWithILoggerFactory() + .Services + .BuildServiceProvider() + .GetRequiredService>() + .Value; + + Assert.Equal( + options.Registrations.Count, + _defaultHealthNames + .Intersect(options.Registrations.Select(x => x.Name)) + .Distinct() + .Count() + ); + } + + [Fact(DisplayName = "AddGraphHealthUsingProviderWithILoggerFactory - Custom Health Name")] + public void AddGraphHealthUsingProviderWithILoggerFactoryCustomHealthName() + { + var options = + new ServiceCollection() + .AddLogging() + .AddHealthChecks() + .AddGraphHealthUsingProviderWithILoggerFactory(_customHealthNames[0]) + .Services + .BuildServiceProvider() + .GetRequiredService>() + .Value; + + Assert.Equal( + options.Registrations.Count, + _customHealthNames .Intersect(options.Registrations.Select(x => x.Name)) .Distinct() .Count() diff --git a/GraphHealthChecks/GraphHealthCheck.cs b/GraphHealthChecks/GraphHealthCheck.cs index 31bf07d..db8772c 100644 --- a/GraphHealthChecks/GraphHealthCheck.cs +++ b/GraphHealthChecks/GraphHealthCheck.cs @@ -7,17 +7,17 @@ public record GraphHealthCheck : IHealthCheck private const string _generalError = "A general error has occurred."; private readonly ILogger? _logger; - private readonly IRequestExecutorManager _requestExecutorResolver; + private readonly IRequestExecutorProvider _requestExecutorProvider; - public GraphHealthCheck(IRequestExecutorManager requestExecutorResolver, ILogger logger) + public GraphHealthCheck(IRequestExecutorProvider requestExecutorProvider, ILogger logger) { - _requestExecutorResolver = requestExecutorResolver; + _requestExecutorProvider = requestExecutorProvider; _logger = logger; } - public GraphHealthCheck(IRequestExecutorManager requestExecutorResolver) + public GraphHealthCheck(IRequestExecutorProvider requestExecutorProvider) { - _requestExecutorResolver = requestExecutorResolver; + _requestExecutorProvider = requestExecutorProvider; } public string? Schema { get; set; } @@ -26,7 +26,7 @@ public async Task CheckHealthAsync(HealthCheckContext context { try { - var executor = await _requestExecutorResolver.GetExecutorAsync( + var executor = await _requestExecutorProvider.GetExecutorAsync( Schema, cancellationToken ); diff --git a/GraphHealthChecks/GraphHealthChecks.csproj b/GraphHealthChecks/GraphHealthChecks.csproj index 1817627..b4bf85d 100644 --- a/GraphHealthChecks/GraphHealthChecks.csproj +++ b/GraphHealthChecks/GraphHealthChecks.csproj @@ -6,7 +6,7 @@ true true $(MSBuildProjectName) - 6.0.1 + 6.1.0 Adamos Fiakkas Graph Health Checks for HotChocolate Adamos Fiakkas @@ -22,8 +22,8 @@ - - + + diff --git a/GraphHealthChecks/GraphHealthChecksFactories.cs b/GraphHealthChecks/GraphHealthChecksFactories.cs index 019bd5c..51918f9 100644 --- a/GraphHealthChecks/GraphHealthChecksFactories.cs +++ b/GraphHealthChecks/GraphHealthChecksFactories.cs @@ -25,4 +25,28 @@ public static Func GraphHealthCheckFactoryWithIL { Schema = schemaName }; + + public static Func GraphHealthCheckFactoryUsingProviderWithNoLogger(string? schemaName = default) => sp => + new GraphHealthCheck(sp.GetRequiredService()) + { + Schema = schemaName + }; + + public static Func GraphHealthCheckFactoryUsingProviderWithILogger(string? schemaName = default) => sp => + new GraphHealthCheck( + sp.GetRequiredService(), + sp.GetRequiredService>() + ) + { + Schema = schemaName + }; + + public static Func GraphHealthCheckFactoryUsingProviderWithILoggerFactory(string? schemaName = default) => sp => + new GraphHealthCheck( + sp.GetRequiredService(), + sp.GetRequiredService().CreateLogger() + ) + { + Schema = schemaName + }; } \ No newline at end of file diff --git a/GraphHealthChecks/GraphHealthExtensions.cs b/GraphHealthChecks/GraphHealthExtensions.cs index a655276..5c05433 100644 --- a/GraphHealthChecks/GraphHealthExtensions.cs +++ b/GraphHealthChecks/GraphHealthExtensions.cs @@ -57,4 +57,58 @@ public static IHealthChecksBuilder AddGraphHealthWithILoggerFactory( timeout ) ); + + public static IHealthChecksBuilder AddGraphHealthUsingProviderWithNoLogger( + this IHealthChecksBuilder builder, + string healthName = _defaultHealthName, + string? schemaName = default, + HealthStatus? failureStatus = default, + IEnumerable? tags = default, + TimeSpan? timeout = default + ) => + builder.Add( + new( + healthName, + GraphHealthChecksFactories.GraphHealthCheckFactoryUsingProviderWithNoLogger(schemaName), + failureStatus, + tags, + timeout + ) + ); + + public static IHealthChecksBuilder AddGraphHealthUsingProviderWithILogger( + this IHealthChecksBuilder builder, + string healthName = _defaultHealthName, + string? schemaName = default, + HealthStatus? failureStatus = default, + IEnumerable? tags = default, + TimeSpan? timeout = default + ) => + builder.Add( + new( + healthName, + GraphHealthChecksFactories.GraphHealthCheckFactoryUsingProviderWithILogger(schemaName), + failureStatus, + tags, + timeout + ) + ); + + public static IHealthChecksBuilder AddGraphHealthUsingProviderWithILoggerFactory( + this IHealthChecksBuilder builder, + string healthName = _defaultHealthName, + string? schemaName = default, + HealthStatus? failureStatus = default, + IEnumerable? tags = default, + TimeSpan? timeout = default + ) => + builder.Add( + new( + healthName, + GraphHealthChecksFactories.GraphHealthCheckFactoryUsingProviderWithILoggerFactory(schemaName), + failureStatus, + tags, + timeout + ) + ); } \ No newline at end of file diff --git a/GraphHealthChecks/README.md b/GraphHealthChecks/README.md index 1474396..ccd3942 100644 --- a/GraphHealthChecks/README.md +++ b/GraphHealthChecks/README.md @@ -12,6 +12,7 @@ The purpose of this middleware is to provide feedback regarding the health of th | HotChocolate Version | GraphHealthChecks Version | .NET Version | | -------------------- | ------------------------- | ------------- | +| 16.6.0 or higher | 6.1.0 | .NET 8, 9, 10 | | 16.0.9 or higher | 6.0.1 | .NET 8, 9, 10 | | 16.0.0 or higher | 6.0.0 | .NET 8, 9, 10 | @@ -48,6 +49,9 @@ Locate the services registration and append one of: - `.AddGraphHealthWithNoLogger` - use when no logging is required - `.AddGraphHealthWithILogger` - use when the ILogger provider is available - `.AddGraphHealthWithILoggerFactory` - use when the ILoggerFactory provider is available +- `.AddGraphHealthUsingProviderWithNoLogger` - use when no logging is required for setups where `IRequestExecutorProvider` is available but `IRequestExecutorManager` is not +- `.AddGraphHealthUsingProviderWithILogger` - use when the ILogger provider is available for setups where `IRequestExecutorProvider` is available but `IRequestExecutorManager` is not +- `.AddGraphHealthUsingProviderWithILoggerFactory` - use when the ILoggerFactory provider is available for setups where `IRequestExecutorProvider` is available but `IRequestExecutorManager` is not ⚠️ Bear in mind that `IHealthChecksBuilder` needs to be appended before any of the aforementioned. diff --git a/README.md b/README.md index e7bf755..4596a1a 100644 --- a/README.md +++ b/README.md @@ -16,6 +16,7 @@ The purpose of this middleware is to provide feedback regarding the health of th | HotChocolate Version | GraphHealthChecks Version | .NET Version | | -------------------- | ------------------------- | ------------- | +| 16.6.0 or higher | 6.1.0 | .NET 8, 9, 10 | | 16.0.9 or higher | 6.0.1 | .NET 8, 9, 10 | | 16.0.0 or higher | 6.0.0 | .NET 8, 9, 10 | @@ -52,6 +53,9 @@ Locate the services registration and append one of: - `.AddGraphHealthWithNoLogger` - use when no logging is required - `.AddGraphHealthWithILogger` - use when the ILogger provider is available - `.AddGraphHealthWithILoggerFactory` - use when the ILoggerFactory provider is available +- `.AddGraphHealthUsingProviderWithNoLogger` - use when no logging is required for setups where `IRequestExecutorProvider` is available but `IRequestExecutorManager` is not +- `.AddGraphHealthUsingProviderWithILogger` - use when the ILogger provider is available for setups where `IRequestExecutorProvider` is available but `IRequestExecutorManager` is not +- `.AddGraphHealthUsingProviderWithILoggerFactory` - use when the ILoggerFactory provider is available for setups where `IRequestExecutorProvider` is available but `IRequestExecutorManager` is not ⚠️ Bear in mind that `IHealthChecksBuilder` needs to be appended before any of the aforementioned.