From 6d03eec85cfae78084ff29fe4579e2ba06c8cf66 Mon Sep 17 00:00:00 2001 From: Konstantin Savosteev Date: Thu, 5 Dec 2024 12:29:07 +0200 Subject: [PATCH] VCST-2241: add scoped schema (#128) --- .../VirtoCommerce.QuoteModule.ExperienceApi.csproj | 1 + src/VirtoCommerce.QuoteModule.Web/Module.cs | 7 +++++++ src/VirtoCommerce.QuoteModule.Web/module.manifest | 2 +- 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/VirtoCommerce.QuoteModule.ExperienceApi/VirtoCommerce.QuoteModule.ExperienceApi.csproj b/src/VirtoCommerce.QuoteModule.ExperienceApi/VirtoCommerce.QuoteModule.ExperienceApi.csproj index 76190961..80760658 100644 --- a/src/VirtoCommerce.QuoteModule.ExperienceApi/VirtoCommerce.QuoteModule.ExperienceApi.csproj +++ b/src/VirtoCommerce.QuoteModule.ExperienceApi/VirtoCommerce.QuoteModule.ExperienceApi.csproj @@ -10,6 +10,7 @@ + diff --git a/src/VirtoCommerce.QuoteModule.Web/Module.cs b/src/VirtoCommerce.QuoteModule.Web/Module.cs index b4e268a9..78be1dd4 100644 --- a/src/VirtoCommerce.QuoteModule.Web/Module.cs +++ b/src/VirtoCommerce.QuoteModule.Web/Module.cs @@ -8,6 +8,7 @@ using Microsoft.EntityFrameworkCore; using Microsoft.Extensions.Configuration; using Microsoft.Extensions.DependencyInjection; +using Microsoft.Extensions.Options; using VirtoCommerce.FileExperienceApi.Core.Authorization; using VirtoCommerce.Platform.Core.Common; using VirtoCommerce.Platform.Core.DynamicProperties; @@ -35,6 +36,7 @@ using VirtoCommerce.StoreModule.Core.Model; using VirtoCommerce.Xapi.Core.Extensions; using VirtoCommerce.Xapi.Core.Infrastructure; +using VirtoCommerce.Xapi.Core.Models; namespace VirtoCommerce.QuoteModule.Web { @@ -88,12 +90,17 @@ public void Initialize(IServiceCollection serviceCollection) serviceCollection.AddTransient(); serviceCollection.AddSingleton(); serviceCollection.AddSingleton(); + + serviceCollection.AddSingleton>(); } public void PostInitialize(IApplicationBuilder appBuilder) { _appBuilder = appBuilder; + var playgroundOptions = appBuilder.ApplicationServices.GetService>(); + appBuilder.UseSchemaGraphQL>(playgroundOptions?.Value?.Enable ?? true, "quote"); + var dynamicPropertyRegistrar = appBuilder.ApplicationServices.GetRequiredService(); dynamicPropertyRegistrar.RegisterType(); diff --git a/src/VirtoCommerce.QuoteModule.Web/module.manifest b/src/VirtoCommerce.QuoteModule.Web/module.manifest index 0ce765ab..0f9df505 100644 --- a/src/VirtoCommerce.QuoteModule.Web/module.manifest +++ b/src/VirtoCommerce.QuoteModule.Web/module.manifest @@ -10,7 +10,7 @@ - +