Skip to content

Commit

Permalink
VCST-2241: add scoped schema (#128)
Browse files Browse the repository at this point in the history
  • Loading branch information
ksavosteev authored Dec 5, 2024
1 parent bf46151 commit 6d03eec
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="8.0.0" PrivateAssets="All" />
<PackageReference Include="VirtoCommerce.FileExperienceApi.Data" Version="3.803.0" />
<PackageReference Include="VirtoCommerce.OrdersModule.Core" Version="3.800.0" />
<PackageReference Include="VirtoCommerce.Xapi.Core" Version="3.814.0" />
<PackageReference Include="VirtoCommerce.XCart.Data" Version="3.800.0" />
</ItemGroup>
<ItemGroup>
Expand Down
7 changes: 7 additions & 0 deletions src/VirtoCommerce.QuoteModule.Web/Module.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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
{
Expand Down Expand Up @@ -88,12 +90,17 @@ public void Initialize(IServiceCollection serviceCollection)
serviceCollection.AddTransient<IQuoteAggregateRepository, QuoteAggregateRepository>();
serviceCollection.AddSingleton<IAuthorizationHandler, QuoteAuthorizationHandler>();
serviceCollection.AddSingleton<IFileAuthorizationRequirementFactory, QuoteAuthorizationRequirementFactory>();

serviceCollection.AddSingleton<ScopedSchemaFactory<AssemblyMarker>>();
}

public void PostInitialize(IApplicationBuilder appBuilder)
{
_appBuilder = appBuilder;

var playgroundOptions = appBuilder.ApplicationServices.GetService<IOptions<GraphQLPlaygroundOptions>>();
appBuilder.UseSchemaGraphQL<ScopedSchemaFactory<AssemblyMarker>>(playgroundOptions?.Value?.Enable ?? true, "quote");

var dynamicPropertyRegistrar = appBuilder.ApplicationServices.GetRequiredService<IDynamicPropertyRegistrar>();
dynamicPropertyRegistrar.RegisterType<QuoteRequest>();

Expand Down
2 changes: 1 addition & 1 deletion src/VirtoCommerce.QuoteModule.Web/module.manifest
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<dependency id="VirtoCommerce.Cart" version="3.810.0" />
<dependency id="VirtoCommerce.Catalog" version="3.800.0" />
<dependency id="VirtoCommerce.Core" version="3.800.0" />
<dependency id="VirtoCommerce.Xapi" version="3.800.0" />
<dependency id="VirtoCommerce.Xapi" version="3.814.0" />
<dependency id="VirtoCommerce.XCart" version="3.800.0" />
<dependency id="VirtoCommerce.XCatalog" version="3.800.0" />
<dependency id="VirtoCommerce.FileExperienceApi" version="3.803.0" />
Expand Down

0 comments on commit 6d03eec

Please sign in to comment.