Skip to content

Commit

Permalink
Revert "feat: v5 update"
Browse files Browse the repository at this point in the history
This reverts commit 5d8ca07.
  • Loading branch information
ksavosteev committed Dec 13, 2024
1 parent 5d8ca07 commit c0b006d
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 18 deletions.
4 changes: 2 additions & 2 deletions src/VirtoCommerce.XCart.Core/Schemas/WishlistScopeType.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ public class WishlistScopeType : EnumerationGraphType
{
public WishlistScopeType()
{
Add(ModuleConstants.PrivateScope, value: ModuleConstants.PrivateScope, description: "Private scope");
Add(ModuleConstants.OrganizationScope, value: ModuleConstants.OrganizationScope, description: "Organization scope");
AddValue(ModuleConstants.PrivateScope, value: ModuleConstants.PrivateScope, description: "Private scope");
AddValue(ModuleConstants.OrganizationScope, value: ModuleConstants.OrganizationScope, description: "Organization scope");
}
}
}
4 changes: 2 additions & 2 deletions src/VirtoCommerce.XCart.Core/VirtoCommerce.XCart.Core.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
<ItemGroup>
<PackageReference Include="FluentValidation" Version="11.10.0" />
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="8.0.0" PrivateAssets="All" />
<PackageReference Include="VirtoCommerce.Xapi.Core" Version="3.816.2" />
<PackageReference Include="VirtoCommerce.XCatalog.Core" Version="3.820.1" />
<PackageReference Include="VirtoCommerce.Xapi.Core" Version="3.815.0" />
<PackageReference Include="VirtoCommerce.XCatalog.Core" Version="3.818.0" />
<PackageReference Include="VirtoCommerce.CartModule.Core" Version="3.822.0" />
<PackageReference Include="VirtoCommerce.PaymentModule.Core" Version="3.804.0" />
<PackageReference Include="VirtoCommerce.ShippingModule.Core" Version="3.802.0" />
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
using System;
using GraphQL.DI;
using GraphQL.Server;
using Microsoft.AspNetCore.Authorization;
using Microsoft.Extensions.DependencyInjection;
using VirtoCommerce.MarketingModule.Core.Model.Promotions;
using VirtoCommerce.PricingModule.Core.Model;
using VirtoCommerce.TaxModule.Core.Model;
using VirtoCommerce.Xapi.Core.Extensions;
using VirtoCommerce.Xapi.Core.Infrastructure;
using VirtoCommerce.Xapi.Core.Pipelines;
using VirtoCommerce.XCart.Core;
using VirtoCommerce.XCart.Core.Models;
Expand All @@ -21,8 +23,9 @@ public static class ServiceCollectionExtensions
{
public static IServiceCollection AddXCart(this IServiceCollection services, IGraphQLBuilder graphQLBuilder)
{
//graphQLBuilder.AddSchema(typeof(CoreAssemblyMarker), typeof(DataAssemblyMarker));
//services.AddSingleton<ScopedSchemaFactory<DataAssemblyMarker>>();
graphQLBuilder.AddSchema(typeof(CoreAssemblyMarker), typeof(DataAssemblyMarker));

services.AddSingleton<ScopedSchemaFactory<DataAssemblyMarker>>();

services.AddSingleton<IAuthorizationHandler, CanAccessCartAuthorizationHandler>();
services.AddTransient<ICartAggregateRepository, CartAggregateRepository>();
Expand Down
4 changes: 2 additions & 2 deletions src/VirtoCommerce.XCart.Data/Schemas/PurchaseSchema.cs
Original file line number Diff line number Diff line change
Expand Up @@ -799,7 +799,7 @@ public void Build(ISchema schema)
new QueryArgument<StringGraphType> { Name = "cartType", Description = "Cart type" },
new QueryArgument<NonNullGraphType<StringGraphType>> { Name = "coupon", Description = "Cart promo coupon code" }),
Type = typeof(BooleanGraphType),
Resolver = new FuncFieldResolver<object>(async context =>
Resolver = new AsyncFieldResolver<object>(async context =>
{
var query = context.GetCartQuery<ValidateCouponQuery>();
query.CartId = context.GetArgumentOrValue<string>("cartId");
Expand Down Expand Up @@ -1272,7 +1272,7 @@ public void Build(ISchema schema)
new QueryArgument<NonNullGraphType<StringGraphType>> { Name = "listId", Description = "List Id" },
new QueryArgument<StringGraphType> { Name = "cultureName", Description = "Culture name (\"en-Us\")" }),
Type = GraphTypeExtenstionHelper.GetActualType<WishlistType>(),
Resolver = new FuncFieldResolver<object>(async context =>
Resolver = new AsyncFieldResolver<object>(async context =>
{
var getListQuery = AbstractTypeFactory<GetWishlistQuery>.TryCreateInstance();
getListQuery.ListId = context.GetArgument<string>("listId");
Expand Down
9 changes: 2 additions & 7 deletions src/VirtoCommerce.XCart.Web/Module.cs
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
using GraphQL.MicrosoftDI;
using Microsoft.AspNetCore.Builder;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using VirtoCommerce.Platform.Core.Modularity;
using VirtoCommerce.Xapi.Core.Extensions;
using VirtoCommerce.XCart.Core;
using VirtoCommerce.Xapi.Core.Infrastructure;
using VirtoCommerce.XCart.Data;
using VirtoCommerce.XCart.Data.Extensions;

Expand All @@ -17,11 +16,7 @@ public class Module : IModule, IHasConfiguration

public void Initialize(IServiceCollection serviceCollection)
{
var graphQlBuilder = new GraphQLBuilder(serviceCollection, builder =>
{
builder.AddSchema(serviceCollection, typeof(CoreAssemblyMarker), typeof(DataAssemblyMarker));
});

var graphQlBuilder = new CustomGraphQLBuilder(serviceCollection);
serviceCollection.AddXCart(graphQlBuilder);
}

Expand Down
4 changes: 2 additions & 2 deletions src/VirtoCommerce.XCart.Web/module.manifest
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
<dependency id="VirtoCommerce.Payment" version="3.804.0" />
<dependency id="VirtoCommerce.Pricing" version="3.809.0" />
<dependency id="VirtoCommerce.Shipping" version="3.802.0" />
<dependency id="VirtoCommerce.Xapi" version="3.816.0" />
<dependency id="VirtoCommerce.XCatalog" version="3.820.0" />
<dependency id="VirtoCommerce.Xapi" version="3.815.0" />
<dependency id="VirtoCommerce.XCatalog" version="3.818.0" />
</dependencies>

<title>Cart Experience API</title>
Expand Down

0 comments on commit c0b006d

Please sign in to comment.