Skip to content

Instantly share code, notes, and snippets.

@wullemsb
Created August 6, 2021 08:07
public void ConfigureServices(IServiceCollection services)
{
services.AddApplicationInsightsTelemetry();
// Build an intermediate service provider
var intermediateProvider = services.BuildServiceProvider();
services.AddGraphQLServer()
.AddQueryType<QueryType>()
.AddDiagnosticEventListener<ApplicationInsightsDiagnosticListener>((sp)=> new ApplicationInsightsDiagnosticListener(intermediateProvider.GetService<TelemetryClient>()));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment