From 64f7040708db0d2e2f50efdb6ff5f8e110b23b5c Mon Sep 17 00:00:00 2001 From: Georg von Kries Date: Thu, 23 May 2024 17:01:14 +0200 Subject: [PATCH] Register GraphQL types as transient to allow resolving them while building the schema. (#16143) --- .../ServiceCollectionExtensions.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/OrchardCore/OrchardCore.Apis.GraphQL.Abstractions/ServiceCollectionExtensions.cs b/src/OrchardCore/OrchardCore.Apis.GraphQL.Abstractions/ServiceCollectionExtensions.cs index 3cb116e7f2b..ca5a2c72663 100644 --- a/src/OrchardCore/OrchardCore.Apis.GraphQL.Abstractions/ServiceCollectionExtensions.cs +++ b/src/OrchardCore/OrchardCore.Apis.GraphQL.Abstractions/ServiceCollectionExtensions.cs @@ -15,7 +15,7 @@ public static void AddInputObjectGraphType(this IServiceCo where TObject : class where TObjectType : InputObjectGraphType { - services.AddScoped(); + services.AddTransient(); services.AddTransient, TObjectType>(s => s.GetRequiredService()); services.AddTransient(s => s.GetRequiredService()); } @@ -30,7 +30,7 @@ public static void AddObjectGraphType(this IServiceCollectio where TInput : class where TInputType : ObjectGraphType { - services.AddScoped(); + services.AddTransient(); services.AddTransient, TInputType>(s => s.GetRequiredService()); services.AddTransient(s => s.GetRequiredService()); }