diff --git a/src/AspNetCore/AspNetCore.csproj b/src/AspNetCore/AspNetCore.csproj index e567ca54..b7bd1382 100644 --- a/src/AspNetCore/AspNetCore.csproj +++ b/src/AspNetCore/AspNetCore.csproj @@ -1,4 +1,4 @@ - + netstandard2.0 @@ -17,7 +17,6 @@ - diff --git a/src/AspNetCore/GraphQLExtensions.cs b/src/AspNetCore/GraphQLExtensions.cs index 4d81c602..231ec9a9 100644 --- a/src/AspNetCore/GraphQLExtensions.cs +++ b/src/AspNetCore/GraphQLExtensions.cs @@ -1,11 +1,10 @@ using GraphQL.Http; +using GraphQL.Subscription; using GraphQL.Types; using Microsoft.AspNetCore.Builder; -using Microsoft.AspNetCore.Hosting; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.DependencyInjection.Extensions; using Microsoft.Extensions.Options; -using Newtonsoft.Json; namespace GraphQL.Server.Transports.AspNetCore { @@ -14,19 +13,11 @@ public static class GraphQLExtensions /// /// Adds the GraphQLHttp to services /// - /// The service collection to register the services on - /// The received as parameter + /// The servicecollection to registrer the services on + /// The recieved as parameter public static IServiceCollection AddGraphQLHttp(this IServiceCollection services) { - services.TryAddSingleton( - x => - { - var hostingEnvironment = x.GetRequiredService(); - var jsonSerializerSettings = x.GetRequiredService>(); - return new DocumentWriter( - hostingEnvironment.IsDevelopment() ? Formatting.Indented : Formatting.None, - jsonSerializerSettings.Value); - }); + services.TryAddSingleton(); services.TryAddSingleton(); return services; @@ -36,8 +27,8 @@ public static IServiceCollection AddGraphQLHttp(this IServiceCollection services /// Adds the GraphQLHttp to services /// /// The to use for generating the userContext used for the GraphQL request - /// The service collection to register the services on - /// The received as parameter + /// The servicecollection to registrer the services on + /// The recieved as parameter public static IServiceCollection AddGraphQLHttp(this IServiceCollection services) where TUserContextBuilder : class, IUserContextBuilder {