Skip to content

Commit

Permalink
VCST-2241: add scoped schema (#11)
Browse files Browse the repository at this point in the history
  • Loading branch information
ksavosteev authored Dec 5, 2024
1 parent a9721ff commit 9e55c65
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="VirtoCommerce.Xapi.Core" Version="3.809.0" />
<PackageReference Include="VirtoCommerce.Xapi.Core" Version="3.814.0" />
<PackageReference Include="VirtoCommerce.Platform.Caching" Version="3.853.0" />
</ItemGroup>
<ItemGroup>
Expand Down
6 changes: 6 additions & 0 deletions src/VirtoCommerce.PushMessages.Web/Module.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Options;
using VirtoCommerce.CustomerModule.Core.Events;
using VirtoCommerce.Platform.Core.Events;
using VirtoCommerce.Platform.Core.Modularity;
Expand All @@ -31,6 +32,7 @@
using VirtoCommerce.StoreModule.Core.Model;
using VirtoCommerce.Xapi.Core.Extensions;
using VirtoCommerce.Xapi.Core.Infrastructure;
using VirtoCommerce.Xapi.Core.Models;

namespace VirtoCommerce.PushMessages.Web;

Expand Down Expand Up @@ -90,12 +92,16 @@ public void Initialize(IServiceCollection serviceCollection)
serviceCollection.AddDistributedMessageService(Configuration);
serviceCollection.AddSingleton<XapiPushMessageRecipientChangedEventHandler>();
serviceCollection.AddSingleton<IAuthorizationHandler, PushMessagesAuthorizationHandler>();
serviceCollection.AddSingleton<ScopedSchemaFactory<AssemblyMarker>>();
}

public void PostInitialize(IApplicationBuilder appBuilder)
{
var serviceProvider = appBuilder.ApplicationServices;

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

// Register settings
var settingsRegistrar = serviceProvider.GetRequiredService<ISettingsRegistrar>();
settingsRegistrar.RegisterSettings(ModuleConstants.Settings.AllSettings, ModuleInfo.Id);
Expand Down
2 changes: 1 addition & 1 deletion src/VirtoCommerce.PushMessages.Web/module.manifest
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<platformVersion>3.853.0</platformVersion>
<dependencies>
<dependency id="VirtoCommerce.Customer" version="3.817.0" />
<dependency id="VirtoCommerce.Xapi" version="3.809.0" />
<dependency id="VirtoCommerce.Xapi" version="3.814.0" />
</dependencies>

<title>Push Messages</title>
Expand Down

0 comments on commit 9e55c65

Please sign in to comment.