From eef5597b9033b87e5923d658990283cfc57729f6 Mon Sep 17 00:00:00 2001 From: Konstantin Savosteev Date: Mon, 16 Dec 2024 13:47:36 +0200 Subject: [PATCH 1/5] Revert "Revert "feat: v5 update"" This reverts commit c0b006df8026b296c49f5d6e447f0a01d4530669. --- .../Schemas/WishlistScopeType.cs | 4 ++-- .../VirtoCommerce.XCart.Core.csproj | 4 ++-- .../Extensions/ServiceCollectionExtensions.cs | 9 +++------ src/VirtoCommerce.XCart.Data/Schemas/PurchaseSchema.cs | 4 ++-- src/VirtoCommerce.XCart.Web/Module.cs | 9 +++++++-- src/VirtoCommerce.XCart.Web/module.manifest | 4 ++-- 6 files changed, 18 insertions(+), 16 deletions(-) diff --git a/src/VirtoCommerce.XCart.Core/Schemas/WishlistScopeType.cs b/src/VirtoCommerce.XCart.Core/Schemas/WishlistScopeType.cs index 87970ca..429a7f6 100644 --- a/src/VirtoCommerce.XCart.Core/Schemas/WishlistScopeType.cs +++ b/src/VirtoCommerce.XCart.Core/Schemas/WishlistScopeType.cs @@ -6,8 +6,8 @@ public class WishlistScopeType : EnumerationGraphType { public WishlistScopeType() { - AddValue(ModuleConstants.PrivateScope, value: ModuleConstants.PrivateScope, description: "Private scope"); - AddValue(ModuleConstants.OrganizationScope, value: ModuleConstants.OrganizationScope, description: "Organization scope"); + Add(ModuleConstants.PrivateScope, value: ModuleConstants.PrivateScope, description: "Private scope"); + Add(ModuleConstants.OrganizationScope, value: ModuleConstants.OrganizationScope, description: "Organization scope"); } } } diff --git a/src/VirtoCommerce.XCart.Core/VirtoCommerce.XCart.Core.csproj b/src/VirtoCommerce.XCart.Core/VirtoCommerce.XCart.Core.csproj index e70ca11..dc99229 100644 --- a/src/VirtoCommerce.XCart.Core/VirtoCommerce.XCart.Core.csproj +++ b/src/VirtoCommerce.XCart.Core/VirtoCommerce.XCart.Core.csproj @@ -10,8 +10,8 @@ - - + + diff --git a/src/VirtoCommerce.XCart.Data/Extensions/ServiceCollectionExtensions.cs b/src/VirtoCommerce.XCart.Data/Extensions/ServiceCollectionExtensions.cs index 0cd4fc3..2a56140 100644 --- a/src/VirtoCommerce.XCart.Data/Extensions/ServiceCollectionExtensions.cs +++ b/src/VirtoCommerce.XCart.Data/Extensions/ServiceCollectionExtensions.cs @@ -1,12 +1,10 @@ using System; -using GraphQL.Server; +using GraphQL.DI; 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; @@ -23,9 +21,8 @@ public static class ServiceCollectionExtensions { public static IServiceCollection AddXCart(this IServiceCollection services, IGraphQLBuilder graphQLBuilder) { - graphQLBuilder.AddSchema(typeof(CoreAssemblyMarker), typeof(DataAssemblyMarker)); - - services.AddSingleton>(); + //graphQLBuilder.AddSchema(typeof(CoreAssemblyMarker), typeof(DataAssemblyMarker)); + //services.AddSingleton>(); services.AddSingleton(); services.AddTransient(); diff --git a/src/VirtoCommerce.XCart.Data/Schemas/PurchaseSchema.cs b/src/VirtoCommerce.XCart.Data/Schemas/PurchaseSchema.cs index e8d4449..85eee11 100644 --- a/src/VirtoCommerce.XCart.Data/Schemas/PurchaseSchema.cs +++ b/src/VirtoCommerce.XCart.Data/Schemas/PurchaseSchema.cs @@ -799,7 +799,7 @@ public void Build(ISchema schema) new QueryArgument { Name = "cartType", Description = "Cart type" }, new QueryArgument> { Name = "coupon", Description = "Cart promo coupon code" }), Type = typeof(BooleanGraphType), - Resolver = new AsyncFieldResolver(async context => + Resolver = new FuncFieldResolver(async context => { var query = context.GetCartQuery(); query.CartId = context.GetArgumentOrValue("cartId"); @@ -1272,7 +1272,7 @@ public void Build(ISchema schema) new QueryArgument> { Name = "listId", Description = "List Id" }, new QueryArgument { Name = "cultureName", Description = "Culture name (\"en-Us\")" }), Type = GraphTypeExtenstionHelper.GetActualType(), - Resolver = new AsyncFieldResolver(async context => + Resolver = new FuncFieldResolver(async context => { var getListQuery = AbstractTypeFactory.TryCreateInstance(); getListQuery.ListId = context.GetArgument("listId"); diff --git a/src/VirtoCommerce.XCart.Web/Module.cs b/src/VirtoCommerce.XCart.Web/Module.cs index 334d71a..32137d3 100644 --- a/src/VirtoCommerce.XCart.Web/Module.cs +++ b/src/VirtoCommerce.XCart.Web/Module.cs @@ -1,9 +1,10 @@ +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.Xapi.Core.Infrastructure; +using VirtoCommerce.XCart.Core; using VirtoCommerce.XCart.Data; using VirtoCommerce.XCart.Data.Extensions; @@ -16,7 +17,11 @@ public class Module : IModule, IHasConfiguration public void Initialize(IServiceCollection serviceCollection) { - var graphQlBuilder = new CustomGraphQLBuilder(serviceCollection); + var graphQlBuilder = new GraphQLBuilder(serviceCollection, builder => + { + builder.AddSchema(serviceCollection, typeof(CoreAssemblyMarker), typeof(DataAssemblyMarker)); + }); + serviceCollection.AddXCart(graphQlBuilder); } diff --git a/src/VirtoCommerce.XCart.Web/module.manifest b/src/VirtoCommerce.XCart.Web/module.manifest index 6bb594a..429eefd 100644 --- a/src/VirtoCommerce.XCart.Web/module.manifest +++ b/src/VirtoCommerce.XCart.Web/module.manifest @@ -12,8 +12,8 @@ - - + + Cart Experience API From 3bcefc4d55085a58e5d6685b70500a2d2bf938d1 Mon Sep 17 00:00:00 2001 From: Konstantin Savosteev Date: Wed, 18 Dec 2024 16:53:59 +0200 Subject: [PATCH 2/5] feat: v8 update --- .../Models/ExpCartAddress.cs | 6 +- .../Models/NewBulkCartItem.cs | 10 +- .../Models/NewCartItem.cs | 4 +- .../Schemas/CartAddressType.cs | 3 +- .../Schemas/ConfigurationLineItemType.cs | 3 +- .../Schemas/GiftItemType.cs | 5 +- .../Schemas/InputAddWishlistBulkItemType.cs | 3 +- .../Schemas/InputAddWishlistItemType.cs | 3 +- .../Schemas/InputAddWishlistItemsType.cs | 3 +- .../Schemas/InputAddressType.cs | 7 +- .../Schemas/InputCartBaseType.cs | 3 +- .../Schemas/InputCartShipmentItemType.cs | 3 +- .../Schemas/InputChangeWishlistType.cs | 3 +- .../Schemas/InputCloneWishlistType.cs | 3 +- .../Schemas/InputCreateWishlistType.cs | 3 +- .../Schemas/InputMoveWishlistItemType.cs | 3 +- .../Schemas/InputPaymentType.cs | 2 +- .../Schemas/InputRemoveCartType.cs | 3 +- .../Schemas/InputRemoveWishlistItemType.cs | 3 +- .../Schemas/InputRemoveWishlistItemsType.cs | 3 +- .../Schemas/InputRemoveWishlistType.cs | 3 +- .../Schemas/InputRenameWishlistType.cs | 3 +- .../Schemas/InputShipmentType.cs | 2 +- .../Schemas/InputUpdateWishlistItemsType.cs | 3 +- .../InputUpdateWishlistLineItemType.cs | 3 +- .../Schemas/LineItemType.cs | 5 +- .../Schemas/PaymentMethodType.cs | 2 +- .../Schemas/PaymentType.cs | 2 +- .../Schemas/ShipmentType.cs | 3 +- .../Schemas/ShippingMethodType.cs | 2 +- .../Schemas/TaxDetailType.cs | 2 +- .../Schemas/ValidationErrorType.cs | 3 +- .../VirtoCommerce.XCart.Core.csproj | 4 +- .../Schemas/PurchaseSchema.cs | 256 +++++++----------- 34 files changed, 169 insertions(+), 200 deletions(-) diff --git a/src/VirtoCommerce.XCart.Core/Models/ExpCartAddress.cs b/src/VirtoCommerce.XCart.Core/Models/ExpCartAddress.cs index 1eced41..e53e11d 100644 --- a/src/VirtoCommerce.XCart.Core/Models/ExpCartAddress.cs +++ b/src/VirtoCommerce.XCart.Core/Models/ExpCartAddress.cs @@ -5,8 +5,9 @@ namespace VirtoCommerce.XCart.Core.Models { - public sealed class ExpCartAddress + public class ExpCartAddress { + public Optional Id { get; set; } public Optional Key { get; set; } public Optional City { get; set; } public Optional CountryCode { get; set; } @@ -28,13 +29,14 @@ public sealed class ExpCartAddress public Optional Description { get; set; } public Optional AddressType { get; set; } - public Address MapTo(Address address) + public virtual Address MapTo(Address address) { if (address == null) { address = AbstractTypeFactory
.TryCreateInstance(); } + Optional.SetValue(Id, x => address.Key = x); Optional.SetValue(Key, x => address.Key = x); Optional.SetValue(City, x => address.City = x); Optional.SetValue(CountryCode, x => address.CountryCode = x); diff --git a/src/VirtoCommerce.XCart.Core/Models/NewBulkCartItem.cs b/src/VirtoCommerce.XCart.Core/Models/NewBulkCartItem.cs index c41c4a9..b95fe21 100644 --- a/src/VirtoCommerce.XCart.Core/Models/NewBulkCartItem.cs +++ b/src/VirtoCommerce.XCart.Core/Models/NewBulkCartItem.cs @@ -5,14 +5,8 @@ namespace VirtoCommerce.XCart.Core.Models /// public class NewBulkCartItem { - public NewBulkCartItem(string productSku, int quantity) - { - ProductSku = productSku; - Quantity = quantity; - } + public string ProductSku { get; set; } - public string ProductSku { get; private set; } - - public int Quantity { get; private set; } + public int Quantity { get; set; } } } diff --git a/src/VirtoCommerce.XCart.Core/Models/NewCartItem.cs b/src/VirtoCommerce.XCart.Core/Models/NewCartItem.cs index f1a167a..cbb043a 100644 --- a/src/VirtoCommerce.XCart.Core/Models/NewCartItem.cs +++ b/src/VirtoCommerce.XCart.Core/Models/NewCartItem.cs @@ -11,11 +11,11 @@ public NewCartItem(string productId, int quantity) Quantity = quantity; } - public string ProductId { get; private set; } + public string ProductId { get; set; } public CartProduct CartProduct { get; set; } - public int Quantity { get; private set; } + public int Quantity { get; set; } /// /// Manual price diff --git a/src/VirtoCommerce.XCart.Core/Schemas/CartAddressType.cs b/src/VirtoCommerce.XCart.Core/Schemas/CartAddressType.cs index 3197681..e981547 100644 --- a/src/VirtoCommerce.XCart.Core/Schemas/CartAddressType.cs +++ b/src/VirtoCommerce.XCart.Core/Schemas/CartAddressType.cs @@ -1,9 +1,10 @@ using GraphQL.Types; using VirtoCommerce.CartModule.Core.Model; +using VirtoCommerce.Xapi.Core.Schemas; namespace VirtoCommerce.XCart.Core.Schemas { - public class CartAddressType : ObjectGraphType
+ public class CartAddressType : ExtendableGraphType
{ public CartAddressType() { diff --git a/src/VirtoCommerce.XCart.Core/Schemas/ConfigurationLineItemType.cs b/src/VirtoCommerce.XCart.Core/Schemas/ConfigurationLineItemType.cs index 17bfc29..2baad7c 100644 --- a/src/VirtoCommerce.XCart.Core/Schemas/ConfigurationLineItemType.cs +++ b/src/VirtoCommerce.XCart.Core/Schemas/ConfigurationLineItemType.cs @@ -1,5 +1,6 @@ using System.Collections.Generic; using System.Linq; +using GraphQL; using GraphQL.DataLoader; using GraphQL.Resolvers; using GraphQL.Types; @@ -27,7 +28,7 @@ public ConfigurationLineItemType( var productField = new FieldType { Name = "product", - Type = GraphTypeExtenstionHelper.GetActualType(), + Type = GraphTypeExtensionHelper.GetActualType(), Resolver = new FuncFieldResolver>(context => { var includeFields = context.SubFields.Values.GetAllNodesPaths(context).ToArray(); diff --git a/src/VirtoCommerce.XCart.Core/Schemas/GiftItemType.cs b/src/VirtoCommerce.XCart.Core/Schemas/GiftItemType.cs index c140a5e..293d4f2 100644 --- a/src/VirtoCommerce.XCart.Core/Schemas/GiftItemType.cs +++ b/src/VirtoCommerce.XCart.Core/Schemas/GiftItemType.cs @@ -1,4 +1,5 @@ using System.Linq; +using GraphQL; using GraphQL.DataLoader; using GraphQL.Resolvers; using GraphQL.Types; @@ -32,7 +33,7 @@ public GiftItemType(IMediator mediator, IDataLoaderContextAccessor dataLoader, I { Name = "id", Description = "Artificial ID for this value object", - Type = GraphTypeExtenstionHelper.GetActualType>(), + Type = GraphTypeExtensionHelper.GetActualType>(), Resolver = new FuncFieldResolver(context => { // CacheKey as Id. CacheKey is determined by the values returned form GetEqualityComponents(). @@ -43,7 +44,7 @@ public GiftItemType(IMediator mediator, IDataLoaderContextAccessor dataLoader, I AddField(new FieldType { Name = "product", - Type = GraphTypeExtenstionHelper.GetActualType(), + Type = GraphTypeExtensionHelper.GetActualType(), Resolver = new FuncFieldResolver>(context => { if (context.Source.ProductId.IsNullOrEmpty()) diff --git a/src/VirtoCommerce.XCart.Core/Schemas/InputAddWishlistBulkItemType.cs b/src/VirtoCommerce.XCart.Core/Schemas/InputAddWishlistBulkItemType.cs index b0ea49a..0b663d0 100644 --- a/src/VirtoCommerce.XCart.Core/Schemas/InputAddWishlistBulkItemType.cs +++ b/src/VirtoCommerce.XCart.Core/Schemas/InputAddWishlistBulkItemType.cs @@ -1,8 +1,9 @@ using GraphQL.Types; +using VirtoCommerce.Xapi.Core.Schemas; namespace VirtoCommerce.XCart.Core.Schemas { - public class InputAddWishlistBulkItemType : InputObjectGraphType + public class InputAddWishlistBulkItemType : ExtendableInputGraphType { public InputAddWishlistBulkItemType() { diff --git a/src/VirtoCommerce.XCart.Core/Schemas/InputAddWishlistItemType.cs b/src/VirtoCommerce.XCart.Core/Schemas/InputAddWishlistItemType.cs index 374b717..786c0f7 100644 --- a/src/VirtoCommerce.XCart.Core/Schemas/InputAddWishlistItemType.cs +++ b/src/VirtoCommerce.XCart.Core/Schemas/InputAddWishlistItemType.cs @@ -1,8 +1,9 @@ using GraphQL.Types; +using VirtoCommerce.Xapi.Core.Schemas; namespace VirtoCommerce.XCart.Core.Schemas { - public class InputAddWishlistItemType : InputObjectGraphType + public class InputAddWishlistItemType : ExtendableInputGraphType { public InputAddWishlistItemType() { diff --git a/src/VirtoCommerce.XCart.Core/Schemas/InputAddWishlistItemsType.cs b/src/VirtoCommerce.XCart.Core/Schemas/InputAddWishlistItemsType.cs index 6f2b224..3db82e0 100644 --- a/src/VirtoCommerce.XCart.Core/Schemas/InputAddWishlistItemsType.cs +++ b/src/VirtoCommerce.XCart.Core/Schemas/InputAddWishlistItemsType.cs @@ -1,8 +1,9 @@ using GraphQL.Types; +using VirtoCommerce.Xapi.Core.Schemas; namespace VirtoCommerce.XCart.Core.Schemas { - public class InputAddWishlistItemsType : InputObjectGraphType + public class InputAddWishlistItemsType : ExtendableInputGraphType { public InputAddWishlistItemsType() { diff --git a/src/VirtoCommerce.XCart.Core/Schemas/InputAddressType.cs b/src/VirtoCommerce.XCart.Core/Schemas/InputAddressType.cs index 10459bc..d10469d 100644 --- a/src/VirtoCommerce.XCart.Core/Schemas/InputAddressType.cs +++ b/src/VirtoCommerce.XCart.Core/Schemas/InputAddressType.cs @@ -1,20 +1,21 @@ using GraphQL.Types; using VirtoCommerce.CartModule.Core.Model; +using VirtoCommerce.Xapi.Core.Schemas; using VirtoCommerce.XCart.Core.Models; namespace VirtoCommerce.XCart.Core.Schemas { - public class InputAddressType : InputObjectGraphType + public class InputAddressType : ExtendableInputGraphType { public InputAddressType() { - Field("id", resolve: context => context.Source.Key, description: "ID"); + Field(x => x.Id, nullable: true).Description("ID"); + Field(x => x.Key, nullable: true).Description("ID"); Field(x => x.City, nullable: true).Description("City"); Field(x => x.CountryCode, nullable: true).Description("Country code"); Field(x => x.CountryName, nullable: true).Description("Country"); Field(x => x.Email, nullable: true).Description("Email"); Field(x => x.FirstName, nullable: true).Description("First name"); - Field(x => x.Key, nullable: true).Description("ID"); Field(x => x.LastName, nullable: true).Description("Last name"); Field(x => x.Line1, nullable: true).Description("Line1"); Field(x => x.Line2, nullable: true).Description("Line2"); diff --git a/src/VirtoCommerce.XCart.Core/Schemas/InputCartBaseType.cs b/src/VirtoCommerce.XCart.Core/Schemas/InputCartBaseType.cs index c894d0f..0da5414 100644 --- a/src/VirtoCommerce.XCart.Core/Schemas/InputCartBaseType.cs +++ b/src/VirtoCommerce.XCart.Core/Schemas/InputCartBaseType.cs @@ -1,8 +1,9 @@ using GraphQL.Types; +using VirtoCommerce.Xapi.Core.Schemas; namespace VirtoCommerce.XCart.Core.Schemas { - public abstract class InputCartBaseType : InputObjectGraphType + public abstract class InputCartBaseType : ExtendableInputGraphType { protected InputCartBaseType() { diff --git a/src/VirtoCommerce.XCart.Core/Schemas/InputCartShipmentItemType.cs b/src/VirtoCommerce.XCart.Core/Schemas/InputCartShipmentItemType.cs index a875d0f..5d50957 100644 --- a/src/VirtoCommerce.XCart.Core/Schemas/InputCartShipmentItemType.cs +++ b/src/VirtoCommerce.XCart.Core/Schemas/InputCartShipmentItemType.cs @@ -1,8 +1,9 @@ using GraphQL.Types; +using VirtoCommerce.Xapi.Core.Schemas; namespace VirtoCommerce.XCart.Core.Schemas { - public class InputCartShipmentItemType : InputObjectGraphType + public class InputCartShipmentItemType : ExtendableInputGraphType { public InputCartShipmentItemType() { diff --git a/src/VirtoCommerce.XCart.Core/Schemas/InputChangeWishlistType.cs b/src/VirtoCommerce.XCart.Core/Schemas/InputChangeWishlistType.cs index 99a91f8..bd139df 100644 --- a/src/VirtoCommerce.XCart.Core/Schemas/InputChangeWishlistType.cs +++ b/src/VirtoCommerce.XCart.Core/Schemas/InputChangeWishlistType.cs @@ -1,8 +1,9 @@ using GraphQL.Types; +using VirtoCommerce.Xapi.Core.Schemas; namespace VirtoCommerce.XCart.Core.Schemas { - public class InputChangeWishlistType : InputObjectGraphType + public class InputChangeWishlistType : ExtendableInputGraphType { public InputChangeWishlistType() { diff --git a/src/VirtoCommerce.XCart.Core/Schemas/InputCloneWishlistType.cs b/src/VirtoCommerce.XCart.Core/Schemas/InputCloneWishlistType.cs index 3f0882a..35cfdf8 100644 --- a/src/VirtoCommerce.XCart.Core/Schemas/InputCloneWishlistType.cs +++ b/src/VirtoCommerce.XCart.Core/Schemas/InputCloneWishlistType.cs @@ -1,8 +1,9 @@ using GraphQL.Types; +using VirtoCommerce.Xapi.Core.Schemas; namespace VirtoCommerce.XCart.Core.Schemas; -public class InputCloneWishlistType : InputObjectGraphType +public class InputCloneWishlistType : ExtendableInputGraphType { public InputCloneWishlistType() { diff --git a/src/VirtoCommerce.XCart.Core/Schemas/InputCreateWishlistType.cs b/src/VirtoCommerce.XCart.Core/Schemas/InputCreateWishlistType.cs index a3d4f8b..7cfe857 100644 --- a/src/VirtoCommerce.XCart.Core/Schemas/InputCreateWishlistType.cs +++ b/src/VirtoCommerce.XCart.Core/Schemas/InputCreateWishlistType.cs @@ -1,8 +1,9 @@ using GraphQL.Types; +using VirtoCommerce.Xapi.Core.Schemas; namespace VirtoCommerce.XPurchase.Schemas { - public class InputCreateWishlistType : InputObjectGraphType + public class InputCreateWishlistType : ExtendableInputGraphType { public InputCreateWishlistType() { diff --git a/src/VirtoCommerce.XCart.Core/Schemas/InputMoveWishlistItemType.cs b/src/VirtoCommerce.XCart.Core/Schemas/InputMoveWishlistItemType.cs index fd8f756..81eca96 100644 --- a/src/VirtoCommerce.XCart.Core/Schemas/InputMoveWishlistItemType.cs +++ b/src/VirtoCommerce.XCart.Core/Schemas/InputMoveWishlistItemType.cs @@ -1,8 +1,9 @@ using GraphQL.Types; +using VirtoCommerce.Xapi.Core.Schemas; namespace VirtoCommerce.XCart.Core.Schemas { - public class InputMoveWishlistItemType : InputObjectGraphType + public class InputMoveWishlistItemType : ExtendableInputGraphType { public InputMoveWishlistItemType() { diff --git a/src/VirtoCommerce.XCart.Core/Schemas/InputPaymentType.cs b/src/VirtoCommerce.XCart.Core/Schemas/InputPaymentType.cs index 85f0832..11ab1e9 100644 --- a/src/VirtoCommerce.XCart.Core/Schemas/InputPaymentType.cs +++ b/src/VirtoCommerce.XCart.Core/Schemas/InputPaymentType.cs @@ -4,7 +4,7 @@ namespace VirtoCommerce.XCart.Core.Schemas { - public class InputPaymentType : InputObjectGraphType + public class InputPaymentType : ExtendableInputGraphType { public InputPaymentType() { diff --git a/src/VirtoCommerce.XCart.Core/Schemas/InputRemoveCartType.cs b/src/VirtoCommerce.XCart.Core/Schemas/InputRemoveCartType.cs index 2ffded3..ce8e739 100644 --- a/src/VirtoCommerce.XCart.Core/Schemas/InputRemoveCartType.cs +++ b/src/VirtoCommerce.XCart.Core/Schemas/InputRemoveCartType.cs @@ -1,8 +1,9 @@ using GraphQL.Types; +using VirtoCommerce.Xapi.Core.Schemas; namespace VirtoCommerce.XCart.Core.Schemas { - public class InputRemoveCartType : InputObjectGraphType + public class InputRemoveCartType : ExtendableInputGraphType { public InputRemoveCartType() { diff --git a/src/VirtoCommerce.XCart.Core/Schemas/InputRemoveWishlistItemType.cs b/src/VirtoCommerce.XCart.Core/Schemas/InputRemoveWishlistItemType.cs index 28dfda5..1fbb8fc 100644 --- a/src/VirtoCommerce.XCart.Core/Schemas/InputRemoveWishlistItemType.cs +++ b/src/VirtoCommerce.XCart.Core/Schemas/InputRemoveWishlistItemType.cs @@ -1,8 +1,9 @@ using GraphQL.Types; +using VirtoCommerce.Xapi.Core.Schemas; namespace VirtoCommerce.XCart.Core.Schemas { - public class InputRemoveWishlistItemType : InputObjectGraphType + public class InputRemoveWishlistItemType : ExtendableInputGraphType { public InputRemoveWishlistItemType() { diff --git a/src/VirtoCommerce.XCart.Core/Schemas/InputRemoveWishlistItemsType.cs b/src/VirtoCommerce.XCart.Core/Schemas/InputRemoveWishlistItemsType.cs index 0444438..a0f5cb4 100644 --- a/src/VirtoCommerce.XCart.Core/Schemas/InputRemoveWishlistItemsType.cs +++ b/src/VirtoCommerce.XCart.Core/Schemas/InputRemoveWishlistItemsType.cs @@ -1,8 +1,9 @@ using GraphQL.Types; +using VirtoCommerce.Xapi.Core.Schemas; namespace VirtoCommerce.XCart.Core.Schemas { - public class InputRemoveWishlistItemsType : InputObjectGraphType + public class InputRemoveWishlistItemsType : ExtendableInputGraphType { public InputRemoveWishlistItemsType() { diff --git a/src/VirtoCommerce.XCart.Core/Schemas/InputRemoveWishlistType.cs b/src/VirtoCommerce.XCart.Core/Schemas/InputRemoveWishlistType.cs index 81a743b..64a3862 100644 --- a/src/VirtoCommerce.XCart.Core/Schemas/InputRemoveWishlistType.cs +++ b/src/VirtoCommerce.XCart.Core/Schemas/InputRemoveWishlistType.cs @@ -1,8 +1,9 @@ using GraphQL.Types; +using VirtoCommerce.Xapi.Core.Schemas; namespace VirtoCommerce.XCart.Core.Schemas { - public class InputRemoveWishlistType : InputObjectGraphType + public class InputRemoveWishlistType : ExtendableInputGraphType { public InputRemoveWishlistType() { diff --git a/src/VirtoCommerce.XCart.Core/Schemas/InputRenameWishlistType.cs b/src/VirtoCommerce.XCart.Core/Schemas/InputRenameWishlistType.cs index 2bc07f8..77a5be8 100644 --- a/src/VirtoCommerce.XCart.Core/Schemas/InputRenameWishlistType.cs +++ b/src/VirtoCommerce.XCart.Core/Schemas/InputRenameWishlistType.cs @@ -1,8 +1,9 @@ using GraphQL.Types; +using VirtoCommerce.Xapi.Core.Schemas; namespace VirtoCommerce.XCart.Core.Schemas { - public class InputRenameWishlistType : InputObjectGraphType + public class InputRenameWishlistType : ExtendableInputGraphType { public InputRenameWishlistType() { diff --git a/src/VirtoCommerce.XCart.Core/Schemas/InputShipmentType.cs b/src/VirtoCommerce.XCart.Core/Schemas/InputShipmentType.cs index f28a03b..6a29ae3 100644 --- a/src/VirtoCommerce.XCart.Core/Schemas/InputShipmentType.cs +++ b/src/VirtoCommerce.XCart.Core/Schemas/InputShipmentType.cs @@ -4,7 +4,7 @@ namespace VirtoCommerce.XCart.Core.Schemas { - public class InputShipmentType : InputObjectGraphType + public class InputShipmentType : ExtendableInputGraphType { public InputShipmentType() { diff --git a/src/VirtoCommerce.XCart.Core/Schemas/InputUpdateWishlistItemsType.cs b/src/VirtoCommerce.XCart.Core/Schemas/InputUpdateWishlistItemsType.cs index 9560dd5..24afe85 100644 --- a/src/VirtoCommerce.XCart.Core/Schemas/InputUpdateWishlistItemsType.cs +++ b/src/VirtoCommerce.XCart.Core/Schemas/InputUpdateWishlistItemsType.cs @@ -1,8 +1,9 @@ using GraphQL.Types; +using VirtoCommerce.Xapi.Core.Schemas; namespace VirtoCommerce.XCart.Core.Schemas { - public class InputUpdateWishlistItemsType : InputObjectGraphType + public class InputUpdateWishlistItemsType : ExtendableInputGraphType { public InputUpdateWishlistItemsType() { diff --git a/src/VirtoCommerce.XCart.Core/Schemas/InputUpdateWishlistLineItemType.cs b/src/VirtoCommerce.XCart.Core/Schemas/InputUpdateWishlistLineItemType.cs index 656b214..1ca71d7 100644 --- a/src/VirtoCommerce.XCart.Core/Schemas/InputUpdateWishlistLineItemType.cs +++ b/src/VirtoCommerce.XCart.Core/Schemas/InputUpdateWishlistLineItemType.cs @@ -1,8 +1,9 @@ using GraphQL.Types; +using VirtoCommerce.Xapi.Core.Schemas; namespace VirtoCommerce.XCart.Core.Schemas { - public class InputUpdateWishlistLineItemType : InputObjectGraphType + public class InputUpdateWishlistLineItemType : ExtendableInputGraphType { public InputUpdateWishlistLineItemType() { diff --git a/src/VirtoCommerce.XCart.Core/Schemas/LineItemType.cs b/src/VirtoCommerce.XCart.Core/Schemas/LineItemType.cs index 8b2ff2f..e0d361d 100644 --- a/src/VirtoCommerce.XCart.Core/Schemas/LineItemType.cs +++ b/src/VirtoCommerce.XCart.Core/Schemas/LineItemType.cs @@ -1,6 +1,7 @@ using System.Collections.Generic; using System.Linq; using AutoMapper; +using GraphQL; using GraphQL.DataLoader; using GraphQL.Resolvers; using GraphQL.Types; @@ -32,7 +33,7 @@ public LineItemType( var productField = new FieldType { Name = "product", - Type = GraphTypeExtenstionHelper.GetActualType(), + Type = GraphTypeExtensionHelper.GetActualType(), Resolver = new FuncFieldResolver>(context => { var includeFields = context.SubFields.Values.GetAllNodesPaths(context).ToArray(); @@ -169,7 +170,7 @@ public LineItemType( var vendorField = new FieldType { Name = "vendor", - Type = GraphTypeExtenstionHelper.GetActualType(), + Type = GraphTypeExtensionHelper.GetActualType(), Resolver = new FuncFieldResolver>(context => { return dataLoader.LoadVendor(memberService, mapper, loaderKey: "cart_vendor", vendorId: context.Source.VendorId); diff --git a/src/VirtoCommerce.XCart.Core/Schemas/PaymentMethodType.cs b/src/VirtoCommerce.XCart.Core/Schemas/PaymentMethodType.cs index 482560f..7df9610 100644 --- a/src/VirtoCommerce.XCart.Core/Schemas/PaymentMethodType.cs +++ b/src/VirtoCommerce.XCart.Core/Schemas/PaymentMethodType.cs @@ -6,7 +6,7 @@ namespace VirtoCommerce.XCart.Core.Schemas { - public class PaymentMethodType : ObjectGraphType + public class PaymentMethodType : ExtendableGraphType { public PaymentMethodType() { diff --git a/src/VirtoCommerce.XCart.Core/Schemas/PaymentType.cs b/src/VirtoCommerce.XCart.Core/Schemas/PaymentType.cs index 059de15..fbe582d 100644 --- a/src/VirtoCommerce.XCart.Core/Schemas/PaymentType.cs +++ b/src/VirtoCommerce.XCart.Core/Schemas/PaymentType.cs @@ -64,7 +64,7 @@ public PaymentType(IMapper mapper, IMemberService memberService, IDataLoaderCont var vendorField = new FieldType { Name = "vendor", - Type = GraphTypeExtenstionHelper.GetActualType(), + Type = GraphTypeExtensionHelper.GetActualType(), Resolver = new FuncFieldResolver>(context => { return dataLoader.LoadVendor(memberService, mapper, loaderKey: "cart_vendor", vendorId: context.Source.VendorId); diff --git a/src/VirtoCommerce.XCart.Core/Schemas/ShipmentType.cs b/src/VirtoCommerce.XCart.Core/Schemas/ShipmentType.cs index 5c7075c..21139ab 100644 --- a/src/VirtoCommerce.XCart.Core/Schemas/ShipmentType.cs +++ b/src/VirtoCommerce.XCart.Core/Schemas/ShipmentType.cs @@ -1,5 +1,6 @@ using System.Linq; using AutoMapper; +using GraphQL; using GraphQL.DataLoader; using GraphQL.Resolvers; using GraphQL.Types; @@ -84,7 +85,7 @@ public ShipmentType(IMapper mapper, var vendorField = new FieldType { Name = "vendor", - Type = GraphTypeExtenstionHelper.GetActualType(), + Type = GraphTypeExtensionHelper.GetActualType(), Resolver = new FuncFieldResolver>(context => { return dataLoader.LoadVendor(memberService, mapper, loaderKey: "cart_vendor", vendorId: context.Source.VendorId); diff --git a/src/VirtoCommerce.XCart.Core/Schemas/ShippingMethodType.cs b/src/VirtoCommerce.XCart.Core/Schemas/ShippingMethodType.cs index 3fe3827..9cda815 100644 --- a/src/VirtoCommerce.XCart.Core/Schemas/ShippingMethodType.cs +++ b/src/VirtoCommerce.XCart.Core/Schemas/ShippingMethodType.cs @@ -6,7 +6,7 @@ namespace VirtoCommerce.XCart.Core.Schemas { - public class ShippingMethodType : ObjectGraphType + public class ShippingMethodType : ExtendableGraphType { public ShippingMethodType() { diff --git a/src/VirtoCommerce.XCart.Core/Schemas/TaxDetailType.cs b/src/VirtoCommerce.XCart.Core/Schemas/TaxDetailType.cs index 8768bce..8e83942 100644 --- a/src/VirtoCommerce.XCart.Core/Schemas/TaxDetailType.cs +++ b/src/VirtoCommerce.XCart.Core/Schemas/TaxDetailType.cs @@ -6,7 +6,7 @@ namespace VirtoCommerce.XCart.Core.Schemas { - public class TaxDetailType : ObjectGraphType + public class TaxDetailType : ExtendableGraphType { public TaxDetailType() { diff --git a/src/VirtoCommerce.XCart.Core/Schemas/ValidationErrorType.cs b/src/VirtoCommerce.XCart.Core/Schemas/ValidationErrorType.cs index 621bf98..a55920f 100644 --- a/src/VirtoCommerce.XCart.Core/Schemas/ValidationErrorType.cs +++ b/src/VirtoCommerce.XCart.Core/Schemas/ValidationErrorType.cs @@ -1,9 +1,10 @@ using GraphQL.Types; +using VirtoCommerce.Xapi.Core.Schemas; using VirtoCommerce.XCart.Core.Models; namespace VirtoCommerce.XCart.Core.Schemas { - public class ValidationErrorType : ObjectGraphType + public class ValidationErrorType : ExtendableGraphType { public ValidationErrorType() { diff --git a/src/VirtoCommerce.XCart.Core/VirtoCommerce.XCart.Core.csproj b/src/VirtoCommerce.XCart.Core/VirtoCommerce.XCart.Core.csproj index dc99229..8051566 100644 --- a/src/VirtoCommerce.XCart.Core/VirtoCommerce.XCart.Core.csproj +++ b/src/VirtoCommerce.XCart.Core/VirtoCommerce.XCart.Core.csproj @@ -10,8 +10,8 @@ - - + + diff --git a/src/VirtoCommerce.XCart.Data/Schemas/PurchaseSchema.cs b/src/VirtoCommerce.XCart.Data/Schemas/PurchaseSchema.cs index 85eee11..1f7a5c4 100644 --- a/src/VirtoCommerce.XCart.Data/Schemas/PurchaseSchema.cs +++ b/src/VirtoCommerce.XCart.Data/Schemas/PurchaseSchema.cs @@ -91,9 +91,8 @@ public void Build(ISchema schema) /// } /// } /// - var addItemField = FieldBuilder.Create(GraphTypeExtenstionHelper.GetActualType()) - .Name("addItem") - .Argument(GraphTypeExtenstionHelper.GetActualComplexType>(), SchemaConstants.CommandName) + var addItemField = FieldBuilder.Create("addItem", GraphTypeExtensionHelper.GetActualType()) + .Argument(GraphTypeExtensionHelper.GetActualComplexType>(), SchemaConstants.CommandName) .ResolveSynchronizedAsync(CartPrefix, "userId", _distributedLockService, async context => { var cartCommand = context.GetCartCommand(); @@ -111,10 +110,9 @@ public void Build(ISchema schema) schema.Mutation.AddField(addItemField); - schema.Mutation.AddField(FieldBuilder - .Create(GraphTypeExtenstionHelper.GetActualType()) - .Name("addGiftItems") - .Argument(GraphTypeExtenstionHelper.GetActualComplexType>(), SchemaConstants.CommandName) + schema.Mutation.AddField(FieldBuilder + .Create("addGiftItems", GraphTypeExtensionHelper.GetActualType()) + .Argument(GraphTypeExtensionHelper.GetActualComplexType>(), SchemaConstants.CommandName) .ResolveSynchronizedAsync(CartPrefix, "userId", _distributedLockService, async context => { var cartCommand = context.GetCartCommand(); @@ -130,10 +128,9 @@ public void Build(ISchema schema) .FieldType ); - schema.Mutation.AddField(FieldBuilder - .Create(GraphTypeExtenstionHelper.GetActualType()) - .Name("rejectGiftItems") - .Argument(GraphTypeExtenstionHelper.GetActualComplexType>(), SchemaConstants.CommandName) + schema.Mutation.AddField(FieldBuilder + .Create("rejectGiftItems", GraphTypeExtensionHelper.GetActualType()) + .Argument(GraphTypeExtensionHelper.GetActualComplexType>(), SchemaConstants.CommandName) .ResolveSynchronizedAsync(CartPrefix, "userId", _distributedLockService, async context => { var cartCommand = context.GetCartCommand(); @@ -165,9 +162,8 @@ public void Build(ISchema schema) /// } /// } /// - var clearCartField = FieldBuilder.Create(GraphTypeExtenstionHelper.GetActualType()) - .Name("clearCart") - .Argument(GraphTypeExtenstionHelper.GetActualComplexType>(), SchemaConstants.CommandName) + var clearCartField = FieldBuilder.Create("clearCart", GraphTypeExtensionHelper.GetActualType()) + .Argument(GraphTypeExtensionHelper.GetActualComplexType>(), SchemaConstants.CommandName) .ResolveSynchronizedAsync(CartPrefix, "userId", _distributedLockService, async context => { var cartCommand = context.GetCartCommand(); @@ -201,9 +197,8 @@ public void Build(ISchema schema) /// } /// } /// - var changeCommentField = FieldBuilder.Create(GraphTypeExtenstionHelper.GetActualType()) - .Name("changeComment") - .Argument(GraphTypeExtenstionHelper.GetActualType(), SchemaConstants.CommandName) + var changeCommentField = FieldBuilder.Create("changeComment", GraphTypeExtensionHelper.GetActualType()) + .Argument(GraphTypeExtensionHelper.GetActualType(), SchemaConstants.CommandName) .ResolveSynchronizedAsync(CartPrefix, "userId", _distributedLockService, async context => { var cartCommand = context.GetCartCommand(); @@ -239,9 +234,8 @@ public void Build(ISchema schema) /// } /// } /// - var changeCartItemPriceField = FieldBuilder.Create(GraphTypeExtenstionHelper.GetActualType()) - .Name("changeCartItemPrice") - .Argument(GraphTypeExtenstionHelper.GetActualComplexType>(), SchemaConstants.CommandName) + var changeCartItemPriceField = FieldBuilder.Create("changeCartItemPrice", GraphTypeExtensionHelper.GetActualType()) + .Argument(GraphTypeExtensionHelper.GetActualComplexType>(), SchemaConstants.CommandName) .ResolveSynchronizedAsync(CartPrefix, "userId", _distributedLockService, async context => { var cartCommand = context.GetCartCommand(); @@ -276,9 +270,8 @@ public void Build(ISchema schema) /// } /// } /// - var changeCartItemQuantityField = FieldBuilder.Create(GraphTypeExtenstionHelper.GetActualType()) - .Name("changeCartItemQuantity") - .Argument(GraphTypeExtenstionHelper.GetActualComplexType>(), SchemaConstants.CommandName) + var changeCartItemQuantityField = FieldBuilder.Create("changeCartItemQuantity", GraphTypeExtensionHelper.GetActualType()) + .Argument(GraphTypeExtensionHelper.GetActualComplexType>(), SchemaConstants.CommandName) .ResolveSynchronizedAsync(CartPrefix, "userId", _distributedLockService, async context => { var cartCommand = context.GetCartCommand(); @@ -296,9 +289,8 @@ public void Build(ISchema schema) schema.Mutation.AddField(changeCartItemQuantityField); - var changeCartItemsQuantityField = FieldBuilder.Create(GraphTypeExtenstionHelper.GetActualType()) - .Name("changeCartItemsQuantity") - .Argument(GraphTypeExtenstionHelper.GetActualComplexType>(), SchemaConstants.CommandName) + var changeCartItemsQuantityField = FieldBuilder.Create("changeCartItemsQuantity", GraphTypeExtensionHelper.GetActualType()) + .Argument(GraphTypeExtensionHelper.GetActualComplexType>(), SchemaConstants.CommandName) .ResolveSynchronizedAsync(CartPrefix, "userId", _distributedLockService, async context => { var cartCommand = context.GetCartCommand(); @@ -315,9 +307,8 @@ public void Build(ISchema schema) schema.Mutation.AddField(changeCartItemsQuantityField); - var changeCartConfiguredItemField = FieldBuilder.Create(GraphTypeExtenstionHelper.GetActualType()) - .Name("changeCartConfiguredItem") - .Argument(GraphTypeExtenstionHelper.GetActualComplexType>(), SchemaConstants.CommandName) + var changeCartConfiguredItemField = FieldBuilder.Create("changeCartConfiguredItem", GraphTypeExtensionHelper.GetActualType()) + .Argument(GraphTypeExtensionHelper.GetActualComplexType>(), SchemaConstants.CommandName) .ResolveSynchronizedAsync(CartPrefix, "userId", _distributedLockService, async context => { var cartCommand = context.GetCartCommand(); @@ -352,9 +343,8 @@ public void Build(ISchema schema) /// } /// } /// - var changeCartItemCommentField = FieldBuilder.Create(GraphTypeExtenstionHelper.GetActualType()) - .Name("changeCartItemComment") - .Argument(GraphTypeExtenstionHelper.GetActualType(), SchemaConstants.CommandName) + var changeCartItemCommentField = FieldBuilder.Create("changeCartItemComment", GraphTypeExtensionHelper.GetActualType()) + .Argument(GraphTypeExtensionHelper.GetActualType(), SchemaConstants.CommandName) .ResolveSynchronizedAsync(CartPrefix, "userId", _distributedLockService, async context => { var cartCommand = context.GetCartCommand(); @@ -391,9 +381,8 @@ public void Build(ISchema schema) /// } /// } /// - var changeCartItemSelectedField = FieldBuilder.Create(GraphTypeExtenstionHelper.GetActualType()) - .Name("changeCartItemSelected") - .Argument(GraphTypeExtenstionHelper.GetActualType(), SchemaConstants.CommandName) + var changeCartItemSelectedField = FieldBuilder.Create("changeCartItemSelected", GraphTypeExtensionHelper.GetActualType()) + .Argument(GraphTypeExtensionHelper.GetActualType(), SchemaConstants.CommandName) .ResolveSynchronizedAsync(CartPrefix, "userId", _distributedLockService, async context => { var cartCommand = context.GetCartCommand(); @@ -408,9 +397,8 @@ public void Build(ISchema schema) schema.Mutation.AddField(changeCartItemSelectedField); - var selectCartItems = FieldBuilder.Create(GraphTypeExtenstionHelper.GetActualType()) - .Name("selectCartItems") - .Argument(GraphTypeExtenstionHelper.GetActualType(), SchemaConstants.CommandName) + var selectCartItems = FieldBuilder.Create("selectCartItems", GraphTypeExtensionHelper.GetActualType()) + .Argument(GraphTypeExtensionHelper.GetActualType(), SchemaConstants.CommandName) .ResolveSynchronizedAsync(CartPrefix, "userId", _distributedLockService, async context => { var cartCommand = context.GetCartCommand(); @@ -426,9 +414,8 @@ public void Build(ISchema schema) schema.Mutation.AddField(selectCartItems); - var unSelectCartItems = FieldBuilder.Create(GraphTypeExtenstionHelper.GetActualType()) - .Name("unSelectCartItems") - .Argument(GraphTypeExtenstionHelper.GetActualType(), SchemaConstants.CommandName) + var unSelectCartItems = FieldBuilder.Create("unSelectCartItems", GraphTypeExtensionHelper.GetActualType()) + .Argument(GraphTypeExtensionHelper.GetActualType(), SchemaConstants.CommandName) .ResolveSynchronizedAsync(CartPrefix, "userId", _distributedLockService, async context => { var cartCommand = context.GetCartCommand(); @@ -443,9 +430,8 @@ public void Build(ISchema schema) schema.Mutation.AddField(unSelectCartItems); - var selectAllCartItems = FieldBuilder.Create(GraphTypeExtenstionHelper.GetActualType()) - .Name("selectAllCartItems") - .Argument(GraphTypeExtenstionHelper.GetActualType(), SchemaConstants.CommandName) + var selectAllCartItems = FieldBuilder.Create("selectAllCartItems", GraphTypeExtensionHelper.GetActualType()) + .Argument(GraphTypeExtensionHelper.GetActualType(), SchemaConstants.CommandName) .ResolveSynchronizedAsync(CartPrefix, "userId", _distributedLockService, async context => { var cartCommand = context.GetCartCommand(); @@ -461,9 +447,8 @@ public void Build(ISchema schema) schema.Mutation.AddField(selectAllCartItems); - var unSelectAllCartItems = FieldBuilder.Create(GraphTypeExtenstionHelper.GetActualType()) - .Name("unSelectAllCartItems") - .Argument(GraphTypeExtenstionHelper.GetActualType(), SchemaConstants.CommandName) + var unSelectAllCartItems = FieldBuilder.Create("unSelectAllCartItems", GraphTypeExtensionHelper.GetActualType()) + .Argument(GraphTypeExtensionHelper.GetActualType(), SchemaConstants.CommandName) .ResolveSynchronizedAsync(CartPrefix, "userId", _distributedLockService, async context => { var cartCommand = context.GetCartCommand(); @@ -497,9 +482,8 @@ public void Build(ISchema schema) /// } /// } /// - var removeCartItemField = FieldBuilder.Create(GraphTypeExtenstionHelper.GetActualType()) - .Name("removeCartItem") - .Argument(GraphTypeExtenstionHelper.GetActualComplexType>(), SchemaConstants.CommandName) + var removeCartItemField = FieldBuilder.Create("removeCartItem", GraphTypeExtensionHelper.GetActualType()) + .Argument(GraphTypeExtensionHelper.GetActualComplexType>(), SchemaConstants.CommandName) .ResolveSynchronizedAsync(CartPrefix, "userId", _distributedLockService, async context => { var cartCommand = context.GetCartCommand(); @@ -516,9 +500,8 @@ public void Build(ISchema schema) schema.Mutation.AddField(removeCartItemField); - var removeCartItemsField = FieldBuilder.Create(GraphTypeExtenstionHelper.GetActualType()) - .Name("removeCartItems") - .Argument(GraphTypeExtenstionHelper.GetActualComplexType>(), SchemaConstants.CommandName) + var removeCartItemsField = FieldBuilder.Create("removeCartItems", GraphTypeExtensionHelper.GetActualType()) + .Argument(GraphTypeExtensionHelper.GetActualComplexType>(), SchemaConstants.CommandName) .ResolveSynchronizedAsync(CartPrefix, "userId", _distributedLockService, async context => { var cartCommand = context.GetCartCommand(); @@ -552,9 +535,8 @@ public void Build(ISchema schema) /// } /// } /// - var addCouponField = FieldBuilder.Create(GraphTypeExtenstionHelper.GetActualType()) - .Name("addCoupon") - .Argument(GraphTypeExtenstionHelper.GetActualComplexType>(), SchemaConstants.CommandName) + var addCouponField = FieldBuilder.Create("addCoupon", GraphTypeExtensionHelper.GetActualType()) + .Argument(GraphTypeExtensionHelper.GetActualComplexType>(), SchemaConstants.CommandName) .ResolveSynchronizedAsync(CartPrefix, "userId", _distributedLockService, async context => { var cartCommand = context.GetCartCommand(); @@ -588,9 +570,8 @@ public void Build(ISchema schema) /// } /// } /// - var removeCouponField = FieldBuilder.Create(GraphTypeExtenstionHelper.GetActualType()) - .Name("removeCoupon") - .Argument(GraphTypeExtenstionHelper.GetActualComplexType>(), SchemaConstants.CommandName) + var removeCouponField = FieldBuilder.Create("removeCoupon", GraphTypeExtensionHelper.GetActualType()) + .Argument(GraphTypeExtensionHelper.GetActualComplexType>(), SchemaConstants.CommandName) .ResolveSynchronizedAsync(CartPrefix, "userId", _distributedLockService, async context => { var cartCommand = context.GetCartCommand(); @@ -624,9 +605,8 @@ public void Build(ISchema schema) /// } /// } /// - var removeShipmentField = FieldBuilder.Create(GraphTypeExtenstionHelper.GetActualType()) - .Name("removeShipment") - .Argument(GraphTypeExtenstionHelper.GetActualComplexType>(), SchemaConstants.CommandName) + var removeShipmentField = FieldBuilder.Create("removeShipment", GraphTypeExtensionHelper.GetActualType()) + .Argument(GraphTypeExtensionHelper.GetActualComplexType>(), SchemaConstants.CommandName) .ResolveSynchronizedAsync(CartPrefix, "userId", _distributedLockService, async context => { var cartCommand = context.GetCartCommand(); @@ -699,9 +679,8 @@ public void Build(ISchema schema) /// } /// } /// - var addOrUpdateCartShipmentField = FieldBuilder.Create(GraphTypeExtenstionHelper.GetActualType()) - .Name("addOrUpdateCartShipment") - .Argument(GraphTypeExtenstionHelper.GetActualComplexType>(), SchemaConstants.CommandName) + var addOrUpdateCartShipmentField = FieldBuilder.Create("addOrUpdateCartShipment", GraphTypeExtensionHelper.GetActualType()) + .Argument(GraphTypeExtensionHelper.GetActualComplexType>(), SchemaConstants.CommandName) .ResolveSynchronizedAsync(CartPrefix, "userId", _distributedLockService, async context => { var cartCommand = context.GetCartCommand(); @@ -767,9 +746,8 @@ public void Build(ISchema schema) /// } /// } /// - var addOrUpdateCartPaymentField = FieldBuilder.Create(GraphTypeExtenstionHelper.GetActualType()) - .Name("addOrUpdateCartPayment") - .Argument(GraphTypeExtenstionHelper.GetActualComplexType>(), SchemaConstants.CommandName) + var addOrUpdateCartPaymentField = FieldBuilder.Create("addOrUpdateCartPayment", GraphTypeExtensionHelper.GetActualType()) + .Argument(GraphTypeExtensionHelper.GetActualComplexType>(), SchemaConstants.CommandName) .ResolveSynchronizedAsync(CartPrefix, "userId", _distributedLockService, async context => { var cartCommand = context.GetCartCommand(); @@ -829,9 +807,8 @@ public void Build(ISchema schema) /// } /// } /// - var margeCartField = FieldBuilder.Create(GraphTypeExtenstionHelper.GetActualType()) - .Name("mergeCart") - .Argument(GraphTypeExtenstionHelper.GetActualComplexType>(), SchemaConstants.CommandName) + var margeCartField = FieldBuilder.Create("mergeCart", GraphTypeExtensionHelper.GetActualType()) + .Argument(GraphTypeExtensionHelper.GetActualComplexType>(), SchemaConstants.CommandName) .ResolveSynchronizedAsync(CartPrefix, "userId", _distributedLockService, async context => { var cartCommand = context.GetCartCommand(); @@ -859,9 +836,8 @@ public void Build(ISchema schema) /// } /// } /// - var removeCartField = FieldBuilder.Create(typeof(BooleanGraphType)) - .Name("removeCart") - .Argument(GraphTypeExtenstionHelper.GetActualComplexType>(), SchemaConstants.CommandName) + var removeCartField = FieldBuilder.Create("removeCart", typeof(BooleanGraphType)) + .Argument(GraphTypeExtensionHelper.GetActualComplexType>(), SchemaConstants.CommandName) .ResolveSynchronizedAsync(CartPrefix, "userId", _distributedLockService, async context => { var command = context.GetArgument(GenericTypeHelper.GetActualType(), SchemaConstants.CommandName) as RemoveCartCommand; @@ -885,9 +861,8 @@ public void Build(ISchema schema) /// } /// } /// - var clearShipmentsField = FieldBuilder.Create(GraphTypeExtenstionHelper.GetActualType()) - .Name("clearShipments") - .Argument(GraphTypeExtenstionHelper.GetActualComplexType>(), SchemaConstants.CommandName) + var clearShipmentsField = FieldBuilder.Create("clearShipments", GraphTypeExtensionHelper.GetActualType()) + .Argument(GraphTypeExtensionHelper.GetActualComplexType>(), SchemaConstants.CommandName) .ResolveSynchronizedAsync(CartPrefix, "userId", _distributedLockService, async context => { var cartCommand = context.GetCartCommand(); @@ -916,9 +891,8 @@ public void Build(ISchema schema) /// } /// } /// - var clearPaymentsField = FieldBuilder.Create(GraphTypeExtenstionHelper.GetActualType()) - .Name("clearPayments") - .Argument(GraphTypeExtenstionHelper.GetActualComplexType>(), SchemaConstants.CommandName) + var clearPaymentsField = FieldBuilder.Create("clearPayments", GraphTypeExtensionHelper.GetActualType()) + .Argument(GraphTypeExtensionHelper.GetActualComplexType>(), SchemaConstants.CommandName) .ResolveSynchronizedAsync(CartPrefix, "userId", _distributedLockService, async context => { var cartCommand = context.GetCartCommand(); @@ -955,9 +929,8 @@ public void Build(ISchema schema) /// } /// } /// - var addOrUpdateCartAddress = FieldBuilder.Create(GraphTypeExtenstionHelper.GetActualType()) - .Name("addOrUpdateCartAddress") - .Argument(GraphTypeExtenstionHelper.GetActualComplexType>(), SchemaConstants.CommandName) + var addOrUpdateCartAddress = FieldBuilder.Create("addOrUpdateCartAddress", GraphTypeExtensionHelper.GetActualType()) + .Argument(GraphTypeExtensionHelper.GetActualComplexType>(), SchemaConstants.CommandName) .ResolveSynchronizedAsync(CartPrefix, "userId", _distributedLockService, async context => { var cartCommand = context.GetCartCommand(); @@ -987,9 +960,8 @@ public void Build(ISchema schema) /// } /// } /// - var removeCartAddressField = FieldBuilder.Create(GraphTypeExtenstionHelper.GetActualType()) - .Name("removeCartAddress") - .Argument(GraphTypeExtenstionHelper.GetActualComplexType>(), SchemaConstants.CommandName) + var removeCartAddressField = FieldBuilder.Create("removeCartAddress", GraphTypeExtensionHelper.GetActualType()) + .Argument(GraphTypeExtensionHelper.GetActualComplexType>(), SchemaConstants.CommandName) .ResolveSynchronizedAsync(CartPrefix, "userId", _distributedLockService, async context => { var cartCommand = context.GetCartCommand(); @@ -1032,9 +1004,8 @@ public void Build(ISchema schema) /// } /// } /// - var addItemsCartField = FieldBuilder.Create(GraphTypeExtenstionHelper.GetActualType()) - .Name("addItemsCart") - .Argument(GraphTypeExtenstionHelper.GetActualComplexType>(), SchemaConstants.CommandName) + var addItemsCartField = FieldBuilder.Create("addItemsCart", GraphTypeExtensionHelper.GetActualType()) + .Argument(GraphTypeExtensionHelper.GetActualComplexType>(), SchemaConstants.CommandName) .ResolveSynchronizedAsync(CartPrefix, "userId", _distributedLockService, async context => { var cartCommand = context.GetCartCommand(); @@ -1074,9 +1045,8 @@ public void Build(ISchema schema) /// } /// } /// - var addItemsBulkCartField = FieldBuilder.Create(GraphTypeExtenstionHelper.GetActualType()) - .Name("addBulkItemsCart") - .Argument(GraphTypeExtenstionHelper.GetActualComplexType>(), SchemaConstants.CommandName) + var addItemsBulkCartField = FieldBuilder.Create("addBulkItemsCart", GraphTypeExtensionHelper.GetActualType()) + .Argument(GraphTypeExtensionHelper.GetActualComplexType>(), SchemaConstants.CommandName) .ResolveSynchronizedAsync(CartPrefix, "userId", _distributedLockService, async context => { var cartCommand = context.GetCartCommand(); @@ -1119,9 +1089,8 @@ public void Build(ISchema schema) /// } /// } /// - var addCartAddressField = FieldBuilder.Create(GraphTypeExtenstionHelper.GetActualType()) - .Name("addCartAddress") - .Argument(GraphTypeExtenstionHelper.GetActualComplexType>(), SchemaConstants.CommandName) + var addCartAddressField = FieldBuilder.Create("addCartAddress", GraphTypeExtensionHelper.GetActualType()) + .Argument(GraphTypeExtensionHelper.GetActualComplexType>(), SchemaConstants.CommandName) .ResolveSynchronizedAsync(CartPrefix, "userId", _distributedLockService, async context => { var cartCommand = context.GetCartCommand(); @@ -1136,9 +1105,8 @@ public void Build(ISchema schema) schema.Mutation.AddField(addCartAddressField); - var updateCartDynamicPropertiesField = FieldBuilder.Create(GraphTypeExtenstionHelper.GetActualType()) - .Name("updateCartDynamicProperties") - .Argument(GraphTypeExtenstionHelper.GetActualComplexType>(), SchemaConstants.CommandName) + var updateCartDynamicPropertiesField = FieldBuilder.Create("updateCartDynamicProperties", GraphTypeExtensionHelper.GetActualType()) + .Argument(GraphTypeExtensionHelper.GetActualComplexType>(), SchemaConstants.CommandName) .ResolveSynchronizedAsync(CartPrefix, "userId", _distributedLockService, async context => { var cartCommand = context.GetCartCommand(); @@ -1153,9 +1121,8 @@ public void Build(ISchema schema) schema.Mutation.AddField(updateCartDynamicPropertiesField); - var updateCartItemDynamicPropertiesField = FieldBuilder.Create(GraphTypeExtenstionHelper.GetActualType()) - .Name("updateCartItemDynamicProperties") - .Argument(GraphTypeExtenstionHelper.GetActualComplexType>(), SchemaConstants.CommandName) + var updateCartItemDynamicPropertiesField = FieldBuilder.Create("updateCartItemDynamicProperties", GraphTypeExtensionHelper.GetActualType()) + .Argument(GraphTypeExtensionHelper.GetActualComplexType>(), SchemaConstants.CommandName) .ResolveSynchronizedAsync(CartPrefix, "userId", _distributedLockService, async context => { var cartCommand = context.GetCartCommand(); @@ -1170,9 +1137,8 @@ public void Build(ISchema schema) schema.Mutation.AddField(updateCartItemDynamicPropertiesField); - var updateCartPaymentDynamicPropertiesField = FieldBuilder.Create(GraphTypeExtenstionHelper.GetActualType()) - .Name("updateCartPaymentDynamicProperties") - .Argument(GraphTypeExtenstionHelper.GetActualComplexType>(), SchemaConstants.CommandName) + var updateCartPaymentDynamicPropertiesField = FieldBuilder.Create("updateCartPaymentDynamicProperties", GraphTypeExtensionHelper.GetActualType()) + .Argument(GraphTypeExtensionHelper.GetActualComplexType>(), SchemaConstants.CommandName) .ResolveSynchronizedAsync(CartPrefix, "userId", _distributedLockService, async context => { var cartCommand = context.GetCartCommand(); @@ -1187,9 +1153,8 @@ public void Build(ISchema schema) schema.Mutation.AddField(updateCartPaymentDynamicPropertiesField); - var updateCartShipmentDynamicPropertiesField = FieldBuilder.Create(GraphTypeExtenstionHelper.GetActualType()) - .Name("updateCartShipmentDynamicProperties") - .Argument(GraphTypeExtenstionHelper.GetActualComplexType>(), SchemaConstants.CommandName) + var updateCartShipmentDynamicPropertiesField = FieldBuilder.Create("updateCartShipmentDynamicProperties", GraphTypeExtensionHelper.GetActualType()) + .Argument(GraphTypeExtensionHelper.GetActualComplexType>(), SchemaConstants.CommandName) .ResolveSynchronizedAsync(CartPrefix, "userId", _distributedLockService, async context => { var cartCommand = context.GetCartCommand(); @@ -1204,9 +1169,8 @@ public void Build(ISchema schema) schema.Mutation.AddField(updateCartShipmentDynamicPropertiesField); - var changePurchaseOrderNumberField = FieldBuilder.Create(GraphTypeExtenstionHelper.GetActualType()) - .Name("changePurchaseOrderNumber") - .Argument(GraphTypeExtenstionHelper.GetActualType(), SchemaConstants.CommandName) + var changePurchaseOrderNumberField = FieldBuilder.Create("changePurchaseOrderNumber", GraphTypeExtensionHelper.GetActualType()) + .Argument(GraphTypeExtensionHelper.GetActualType(), SchemaConstants.CommandName) .ResolveSynchronizedAsync(CartPrefix, "userId", _distributedLockService, async context => { var cartCommand = context.GetCartCommand(); @@ -1239,9 +1203,8 @@ public void Build(ISchema schema) /// } /// } /// - var refreshCartField = FieldBuilder.Create(GraphTypeExtenstionHelper.GetActualType()) - .Name("refreshCart") - .Argument(GraphTypeExtenstionHelper.GetActualComplexType>(), SchemaConstants.CommandName) + var refreshCartField = FieldBuilder.Create("refreshCart", GraphTypeExtensionHelper.GetActualType()) + .Argument(GraphTypeExtensionHelper.GetActualComplexType>(), SchemaConstants.CommandName) //PT-5394: Write the unit-tests for successfully mapping input variable to the command .ResolveSynchronizedAsync(CartPrefix, "userId", _distributedLockService, async context => { @@ -1271,7 +1234,7 @@ public void Build(ISchema schema) Arguments = new QueryArguments( new QueryArgument> { Name = "listId", Description = "List Id" }, new QueryArgument { Name = "cultureName", Description = "Culture name (\"en-Us\")" }), - Type = GraphTypeExtenstionHelper.GetActualType(), + Type = GraphTypeExtensionHelper.GetActualType(), Resolver = new FuncFieldResolver(async context => { var getListQuery = AbstractTypeFactory.TryCreateInstance(); @@ -1298,8 +1261,7 @@ public void Build(ISchema schema) }; schema.Query.AddField(listField); - var listConnectionBuilder = GraphTypeExtenstionHelper.CreateConnection() - .Name("wishlists") + var listConnectionBuilder = GraphTypeExtensionHelper.CreateConnection("wishlists") .Argument("storeId", "Store Id") .Argument("userId", "User Id") .Argument("currencyCode", "Currency Code") @@ -1313,9 +1275,8 @@ public void Build(ISchema schema) // Mutations // Add list - var addListField = FieldBuilder.Create(GraphTypeExtenstionHelper.GetActualType()) - .Name("createWishlist") - .Argument(GraphTypeExtenstionHelper.GetActualComplexType>(), SchemaConstants.CommandName) + var createListField = FieldBuilder.Create("createWishlist", GraphTypeExtensionHelper.GetActualType()) + .Argument(GraphTypeExtensionHelper.GetActualComplexType>(), SchemaConstants.CommandName) .ResolveAsync(async context => { var commandType = GenericTypeHelper.GetActualType(); @@ -1327,12 +1288,11 @@ public void Build(ISchema schema) }) .FieldType; - schema.Mutation.AddField(addListField); + schema.Mutation.AddField(createListField); // Clone list - var cloneListField = FieldBuilder.Create(GraphTypeExtenstionHelper.GetActualType()) - .Name("cloneWishlist") - .Argument(GraphTypeExtenstionHelper.GetActualComplexType>(), SchemaConstants.CommandName) + var cloneListField = FieldBuilder.Create("cloneWishlist", GraphTypeExtensionHelper.GetActualType()) + .Argument(GraphTypeExtensionHelper.GetActualComplexType>(), SchemaConstants.CommandName) .ResolveAsync(async context => { var commandType = GenericTypeHelper.GetActualType(); @@ -1348,9 +1308,8 @@ public void Build(ISchema schema) schema.Mutation.AddField(cloneListField); // Change list - var changeListField = FieldBuilder.Create(GraphTypeExtenstionHelper.GetActualType()) - .Name("changeWishlist") - .Argument(GraphTypeExtenstionHelper.GetActualComplexType>(), SchemaConstants.CommandName) + var changeListField = FieldBuilder.Create("changeWishlist", GraphTypeExtensionHelper.GetActualType()) + .Argument(GraphTypeExtensionHelper.GetActualComplexType>(), SchemaConstants.CommandName) .ResolveAsync(async context => { var commandType = GenericTypeHelper.GetActualType(); @@ -1366,9 +1325,8 @@ public void Build(ISchema schema) schema.Mutation.AddField(changeListField); // Rename list - var renameListField = FieldBuilder.Create(GraphTypeExtenstionHelper.GetActualType()) - .Name("renameWishlist") - .Argument(GraphTypeExtenstionHelper.GetActualComplexType>(), SchemaConstants.CommandName) + var renameListField = FieldBuilder.Create("renameWishlist", GraphTypeExtensionHelper.GetActualType()) + .Argument(GraphTypeExtensionHelper.GetActualComplexType>(), SchemaConstants.CommandName) .ResolveAsync(async context => { var commandType = GenericTypeHelper.GetActualType(); @@ -1384,9 +1342,8 @@ public void Build(ISchema schema) schema.Mutation.AddField(renameListField); // Remove list - var removeListField = FieldBuilder.Create(typeof(BooleanGraphType)) - .Name("removeWishlist") - .Argument(GraphTypeExtenstionHelper.GetActualComplexType>(), SchemaConstants.CommandName) + var removeListField = FieldBuilder.Create("removeWishlist", typeof(BooleanGraphType)) + .Argument(GraphTypeExtensionHelper.GetActualComplexType>(), SchemaConstants.CommandName) .ResolveAsync(async context => { var commandType = GenericTypeHelper.GetActualType(); @@ -1400,9 +1357,8 @@ public void Build(ISchema schema) schema.Mutation.AddField(removeListField); // Add product to list - var addListItemField = FieldBuilder.Create(GraphTypeExtenstionHelper.GetActualType()) - .Name("addWishlistItem") - .Argument(GraphTypeExtenstionHelper.GetActualComplexType>(), SchemaConstants.CommandName) + var addListItemField = FieldBuilder.Create("addWishlistItem", GraphTypeExtensionHelper.GetActualType()) + .Argument(GraphTypeExtensionHelper.GetActualComplexType>(), SchemaConstants.CommandName) .ResolveAsync(async context => { var commandType = GenericTypeHelper.GetActualType(); @@ -1418,9 +1374,8 @@ public void Build(ISchema schema) schema.Mutation.AddField(addListItemField); // Update wishlist item - var updateListItemField = FieldBuilder.Create(GraphTypeExtenstionHelper.GetActualType()) - .Name("updateWishListItems") - .Argument(GraphTypeExtenstionHelper.GetActualComplexType>(), SchemaConstants.CommandName) + var updateListItemField = FieldBuilder.Create("updateWishListItems", GraphTypeExtensionHelper.GetActualType()) + .Argument(GraphTypeExtensionHelper.GetActualComplexType>(), SchemaConstants.CommandName) .ResolveAsync(async context => { var commandType = GenericTypeHelper.GetActualType(); @@ -1436,9 +1391,8 @@ public void Build(ISchema schema) schema.Mutation.AddField(updateListItemField); // Add product to wishlists - var addWishlistBulkItemField = FieldBuilder.Create(GraphTypeExtenstionHelper.GetActualType()) - .Name("addWishlistBulkItem") - .Argument(GraphTypeExtenstionHelper.GetActualComplexType>(), SchemaConstants.CommandName) + var addWishlistBulkItemField = FieldBuilder.Create("addWishlistBulkItem", GraphTypeExtensionHelper.GetActualType()) + .Argument(GraphTypeExtensionHelper.GetActualComplexType>(), SchemaConstants.CommandName) .ResolveAsync(async context => { var commandType = GenericTypeHelper.GetActualType(); @@ -1457,9 +1411,8 @@ public void Build(ISchema schema) schema.Mutation.AddField(addWishlistBulkItemField); // Add products to wishlist - var addWishlistItemsField = FieldBuilder.Create(GraphTypeExtenstionHelper.GetActualType()) - .Name("addWishlistItems") - .Argument(GraphTypeExtenstionHelper.GetActualComplexType>(), SchemaConstants.CommandName) + var addWishlistItemsField = FieldBuilder.Create("addWishlistItems", GraphTypeExtensionHelper.GetActualType()) + .Argument(GraphTypeExtensionHelper.GetActualComplexType>(), SchemaConstants.CommandName) .ResolveAsync(async context => { var command = context.GetArgument(SchemaConstants.CommandName); @@ -1473,9 +1426,8 @@ public void Build(ISchema schema) schema.Mutation.AddField(addWishlistItemsField); // Remove product from list - var removeListItemField = FieldBuilder.Create(GraphTypeExtenstionHelper.GetActualType()) - .Name("removeWishlistItem") - .Argument(GraphTypeExtenstionHelper.GetActualComplexType>(), SchemaConstants.CommandName) + var removeListItemField = FieldBuilder.Create("removeWishlistItem", GraphTypeExtensionHelper.GetActualType()) + .Argument(GraphTypeExtensionHelper.GetActualComplexType>(), SchemaConstants.CommandName) .ResolveAsync(async context => { var commandType = GenericTypeHelper.GetActualType(); @@ -1490,9 +1442,8 @@ public void Build(ISchema schema) schema.Mutation.AddField(removeListItemField); // Remove products from list - var removeListItemsField = FieldBuilder.Create(GraphTypeExtenstionHelper.GetActualType()) - .Name("removeWishlistItems") - .Argument(GraphTypeExtenstionHelper.GetActualComplexType>(), SchemaConstants.CommandName) + var removeListItemsField = FieldBuilder.Create("removeWishlistItems", GraphTypeExtensionHelper.GetActualType()) + .Argument(GraphTypeExtensionHelper.GetActualComplexType>(), SchemaConstants.CommandName) .ResolveAsync(async context => { var commandType = GenericTypeHelper.GetActualType(); @@ -1507,9 +1458,8 @@ public void Build(ISchema schema) schema.Mutation.AddField(removeListItemsField); // Move product to another list - var moveListItemField = FieldBuilder.Create(GraphTypeExtenstionHelper.GetActualType()) - .Name("moveWishlistItem") - .Argument(GraphTypeExtenstionHelper.GetActualComplexType>(), SchemaConstants.CommandName) + var moveListItemField = FieldBuilder.Create("moveWishlistItem", GraphTypeExtensionHelper.GetActualType()) + .Argument(GraphTypeExtensionHelper.GetActualComplexType>(), SchemaConstants.CommandName) .ResolveAsync(async context => { var commandType = GenericTypeHelper.GetActualType(); From 87d58317b190061d74206608c758de8e40b91b54 Mon Sep 17 00:00:00 2001 From: Konstantin Savosteev Date: Thu, 26 Dec 2024 10:13:21 +0200 Subject: [PATCH 3/5] feat: update dependencies --- src/VirtoCommerce.XCart.Core/VirtoCommerce.XCart.Core.csproj | 4 ++-- .../Extensions/ServiceCollectionExtensions.cs | 2 +- src/VirtoCommerce.XCart.Web/Module.cs | 3 ++- src/VirtoCommerce.XCart.Web/module.manifest | 2 +- 4 files changed, 6 insertions(+), 5 deletions(-) diff --git a/src/VirtoCommerce.XCart.Core/VirtoCommerce.XCart.Core.csproj b/src/VirtoCommerce.XCart.Core/VirtoCommerce.XCart.Core.csproj index 8051566..b360854 100644 --- a/src/VirtoCommerce.XCart.Core/VirtoCommerce.XCart.Core.csproj +++ b/src/VirtoCommerce.XCart.Core/VirtoCommerce.XCart.Core.csproj @@ -10,8 +10,8 @@ - - + + diff --git a/src/VirtoCommerce.XCart.Data/Extensions/ServiceCollectionExtensions.cs b/src/VirtoCommerce.XCart.Data/Extensions/ServiceCollectionExtensions.cs index 2a56140..d55add7 100644 --- a/src/VirtoCommerce.XCart.Data/Extensions/ServiceCollectionExtensions.cs +++ b/src/VirtoCommerce.XCart.Data/Extensions/ServiceCollectionExtensions.cs @@ -21,7 +21,7 @@ public static class ServiceCollectionExtensions { public static IServiceCollection AddXCart(this IServiceCollection services, IGraphQLBuilder graphQLBuilder) { - //graphQLBuilder.AddSchema(typeof(CoreAssemblyMarker), typeof(DataAssemblyMarker)); + // disabled scoped schema //services.AddSingleton>(); services.AddSingleton(); diff --git a/src/VirtoCommerce.XCart.Web/Module.cs b/src/VirtoCommerce.XCart.Web/Module.cs index 32137d3..9b9516d 100644 --- a/src/VirtoCommerce.XCart.Web/Module.cs +++ b/src/VirtoCommerce.XCart.Web/Module.cs @@ -27,7 +27,8 @@ public void Initialize(IServiceCollection serviceCollection) public void PostInitialize(IApplicationBuilder appBuilder) { - appBuilder.UseScopedSchema("cart"); + // disable scoped schema + //appBuilder.UseScopedSchema("cart"); } public void Uninstall() diff --git a/src/VirtoCommerce.XCart.Web/module.manifest b/src/VirtoCommerce.XCart.Web/module.manifest index 429eefd..2f88162 100644 --- a/src/VirtoCommerce.XCart.Web/module.manifest +++ b/src/VirtoCommerce.XCart.Web/module.manifest @@ -13,7 +13,7 @@ - + Cart Experience API From 0e5a96ad70f1f9c4621e829014d3c444d2796f02 Mon Sep 17 00:00:00 2001 From: Konstantin Savosteev Date: Thu, 26 Dec 2024 10:19:05 +0200 Subject: [PATCH 4/5] fix: update mutation --- src/VirtoCommerce.XCart.Data/Schemas/PurchaseSchema.cs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/VirtoCommerce.XCart.Data/Schemas/PurchaseSchema.cs b/src/VirtoCommerce.XCart.Data/Schemas/PurchaseSchema.cs index 21487f1..376330e 100644 --- a/src/VirtoCommerce.XCart.Data/Schemas/PurchaseSchema.cs +++ b/src/VirtoCommerce.XCart.Data/Schemas/PurchaseSchema.cs @@ -825,9 +825,8 @@ public void Build(ISchema schema) schema.Mutation.AddField(margeCartField); - var changeCartCurrency = FieldBuilder.Create(GraphTypeExtenstionHelper.GetActualType()) - .Name("changeCartCurrency") - .Argument(GraphTypeExtenstionHelper.GetActualComplexType>(), SchemaConstants.CommandName) + var changeCartCurrency = FieldBuilder.Create("changeCartCurrency", GraphTypeExtensionHelper.GetActualType()) + .Argument(GraphTypeExtensionHelper.GetActualComplexType>(), SchemaConstants.CommandName) .ResolveSynchronizedAsync(CartPrefix, "userId", _distributedLockService, async context => { var cartCommand = context.GetCartCommand(); From 0ec967c118a8f98c0584d4b2035d6818a778c908 Mon Sep 17 00:00:00 2001 From: Konstantin Savosteev Date: Thu, 26 Dec 2024 16:36:00 +0200 Subject: [PATCH 5/5] feat: change ExpCartAddress --- src/VirtoCommerce.XCart.Core/Models/ExpCartAddress.cs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/VirtoCommerce.XCart.Core/Models/ExpCartAddress.cs b/src/VirtoCommerce.XCart.Core/Models/ExpCartAddress.cs index e53e11d..d08aebe 100644 --- a/src/VirtoCommerce.XCart.Core/Models/ExpCartAddress.cs +++ b/src/VirtoCommerce.XCart.Core/Models/ExpCartAddress.cs @@ -7,7 +7,7 @@ namespace VirtoCommerce.XCart.Core.Models { public class ExpCartAddress { - public Optional Id { get; set; } + public Optional Id { get => Key; set => Key = value; } public Optional Key { get; set; } public Optional City { get; set; } public Optional CountryCode { get; set; } @@ -36,7 +36,6 @@ public virtual Address MapTo(Address address) address = AbstractTypeFactory
.TryCreateInstance(); } - Optional.SetValue(Id, x => address.Key = x); Optional.SetValue(Key, x => address.Key = x); Optional.SetValue(City, x => address.City = x); Optional.SetValue(CountryCode, x => address.CountryCode = x);