Skip to content

Commit

Permalink
Copy EnableMetrics from configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
RehanSaeed committed Mar 5, 2019
1 parent 0517c6e commit 9751ad3
Showing 1 changed file with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -170,12 +170,14 @@ public static IServiceCollection AddCustomGraphQL(this IServiceCollection servic
.AddGraphQL(
options =>
{
// Set some limits for security, read from configuration.
options.ComplexityConfiguration = services
var configuration = services
.BuildServiceProvider()
.GetRequiredService<IOptions<GraphQLOptions>>()
.Value
.ComplexityConfiguration;
.Value;
// Set some limits for security, read from configuration.
options.ComplexityConfiguration = configuration.ComplexityConfiguration;
// Enable GraphQL metrics to be output in the response, read from configuration.
options.EnableMetrics = configuration.EnableMetrics;
// Show stack traces in exceptions. Don't turn this on in production.
options.ExposeExceptions = hostingEnvironment.IsDevelopment();
})
Expand Down

0 comments on commit 9751ad3

Please sign in to comment.