diff --git a/src/VirtoCommerce.XCart.Core/Schemas/WishlistScopeType.cs b/src/VirtoCommerce.XCart.Core/Schemas/WishlistScopeType.cs index 429a7f6..87970ca 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() { - 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"); } } } diff --git a/src/VirtoCommerce.XCart.Core/VirtoCommerce.XCart.Core.csproj b/src/VirtoCommerce.XCart.Core/VirtoCommerce.XCart.Core.csproj index dc99229..e70ca11 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..0cd4fc3 100644 --- a/src/VirtoCommerce.XCart.Data/Extensions/ServiceCollectionExtensions.cs +++ b/src/VirtoCommerce.XCart.Data/Extensions/ServiceCollectionExtensions.cs @@ -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; @@ -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>(); + 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 85eee11..e8d4449 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 FuncFieldResolver(async context => + Resolver = new AsyncFieldResolver(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 FuncFieldResolver(async context => + Resolver = new AsyncFieldResolver(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 32137d3..334d71a 100644 --- a/src/VirtoCommerce.XCart.Web/Module.cs +++ b/src/VirtoCommerce.XCart.Web/Module.cs @@ -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; @@ -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); } diff --git a/src/VirtoCommerce.XCart.Web/module.manifest b/src/VirtoCommerce.XCart.Web/module.manifest index 429eefd..6bb594a 100644 --- a/src/VirtoCommerce.XCart.Web/module.manifest +++ b/src/VirtoCommerce.XCart.Web/module.manifest @@ -12,8 +12,8 @@ - - + + Cart Experience API