Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

VCST-2376: update GraphQL.NET to v8 #27

Open
wants to merge 6 commits into
base: dev
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions src/VirtoCommerce.XCart.Core/Models/ExpCartAddress.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,9 @@

namespace VirtoCommerce.XCart.Core.Models
{
public sealed class ExpCartAddress
public class ExpCartAddress
{
public Optional<string> Id { get => Key; set => Key = value; }
public Optional<string> Key { get; set; }
public Optional<string> City { get; set; }
public Optional<string> CountryCode { get; set; }
Expand All @@ -28,7 +29,7 @@ public sealed class ExpCartAddress
public Optional<string> Description { get; set; }
public Optional<int> AddressType { get; set; }

public Address MapTo(Address address)
public virtual Address MapTo(Address address)
{
if (address == null)
{
Expand Down
10 changes: 2 additions & 8 deletions src/VirtoCommerce.XCart.Core/Models/NewBulkCartItem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,8 @@ namespace VirtoCommerce.XCart.Core.Models
/// </summary>
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; }
}
}
4 changes: 2 additions & 2 deletions src/VirtoCommerce.XCart.Core/Models/NewCartItem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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; }

/// <summary>
/// Manual price
Expand Down
3 changes: 2 additions & 1 deletion src/VirtoCommerce.XCart.Core/Schemas/CartAddressType.cs
Original file line number Diff line number Diff line change
@@ -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<Address>
public class CartAddressType : ExtendableGraphType<Address>
{
public CartAddressType()
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using System.Collections.Generic;
using System.Linq;
using GraphQL;
using GraphQL.DataLoader;
using GraphQL.Resolvers;
using GraphQL.Types;
Expand Down Expand Up @@ -27,7 +28,7 @@ public ConfigurationLineItemType(
var productField = new FieldType
{
Name = "product",
Type = GraphTypeExtenstionHelper.GetActualType<ProductType>(),
Type = GraphTypeExtensionHelper.GetActualType<ProductType>(),
Resolver = new FuncFieldResolver<ExpConfigurationLineItem, IDataLoaderResult<ExpProduct>>(context =>
{
var includeFields = context.SubFields.Values.GetAllNodesPaths(context).ToArray();
Expand Down
5 changes: 3 additions & 2 deletions src/VirtoCommerce.XCart.Core/Schemas/GiftItemType.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using System.Linq;
using GraphQL;
using GraphQL.DataLoader;
using GraphQL.Resolvers;
using GraphQL.Types;
Expand Down Expand Up @@ -32,7 +33,7 @@ public GiftItemType(IMediator mediator, IDataLoaderContextAccessor dataLoader, I
{
Name = "id",
Description = "Artificial ID for this value object",
Type = GraphTypeExtenstionHelper.GetActualType<NonNullGraphType<StringGraphType>>(),
Type = GraphTypeExtensionHelper.GetActualType<NonNullGraphType<StringGraphType>>(),
Resolver = new FuncFieldResolver<GiftItem, string>(context =>
{
// CacheKey as Id. CacheKey is determined by the values returned form GetEqualityComponents().
Expand All @@ -43,7 +44,7 @@ public GiftItemType(IMediator mediator, IDataLoaderContextAccessor dataLoader, I
AddField(new FieldType
{
Name = "product",
Type = GraphTypeExtenstionHelper.GetActualType<ProductType>(),
Type = GraphTypeExtensionHelper.GetActualType<ProductType>(),
Resolver = new FuncFieldResolver<GiftItem, IDataLoaderResult<ExpProduct>>(context =>
{
if (context.Source.ProductId.IsNullOrEmpty())
Expand Down
Original file line number Diff line number Diff line change
@@ -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()
{
Expand Down
Original file line number Diff line number Diff line change
@@ -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()
{
Expand Down
Original file line number Diff line number Diff line change
@@ -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()
{
Expand Down
7 changes: 4 additions & 3 deletions src/VirtoCommerce.XCart.Core/Schemas/InputAddressType.cs
Original file line number Diff line number Diff line change
@@ -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<ExpCartAddress>
public class InputAddressType : ExtendableInputGraphType<ExpCartAddress>
{
public InputAddressType()
{
Field<StringGraphType>("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");
Expand Down
3 changes: 2 additions & 1 deletion src/VirtoCommerce.XCart.Core/Schemas/InputCartBaseType.cs
Original file line number Diff line number Diff line change
@@ -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()
{
Expand Down
Original file line number Diff line number Diff line change
@@ -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()
{
Expand Down
Original file line number Diff line number Diff line change
@@ -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()
{
Expand Down
Original file line number Diff line number Diff line change
@@ -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()
{
Expand Down
Original file line number Diff line number Diff line change
@@ -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()
{
Expand Down
Original file line number Diff line number Diff line change
@@ -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()
{
Expand Down
2 changes: 1 addition & 1 deletion src/VirtoCommerce.XCart.Core/Schemas/InputPaymentType.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

namespace VirtoCommerce.XCart.Core.Schemas
{
public class InputPaymentType : InputObjectGraphType<ExpCartPayment>
public class InputPaymentType : ExtendableInputGraphType<ExpCartPayment>
{
public InputPaymentType()
{
Expand Down
3 changes: 2 additions & 1 deletion src/VirtoCommerce.XCart.Core/Schemas/InputRemoveCartType.cs
Original file line number Diff line number Diff line change
@@ -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()
{
Expand Down
Original file line number Diff line number Diff line change
@@ -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()
{
Expand Down
Original file line number Diff line number Diff line change
@@ -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()
{
Expand Down
Original file line number Diff line number Diff line change
@@ -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()
{
Expand Down
Original file line number Diff line number Diff line change
@@ -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()
{
Expand Down
2 changes: 1 addition & 1 deletion src/VirtoCommerce.XCart.Core/Schemas/InputShipmentType.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

namespace VirtoCommerce.XCart.Core.Schemas
{
public class InputShipmentType : InputObjectGraphType<ExpCartShipment>
public class InputShipmentType : ExtendableInputGraphType<ExpCartShipment>
{
public InputShipmentType()
{
Expand Down
Original file line number Diff line number Diff line change
@@ -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()
{
Expand Down
Original file line number Diff line number Diff line change
@@ -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()
{
Expand Down
5 changes: 3 additions & 2 deletions src/VirtoCommerce.XCart.Core/Schemas/LineItemType.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
using System.Collections.Generic;
using System.Linq;
using AutoMapper;
using GraphQL;
using GraphQL.DataLoader;
using GraphQL.Resolvers;
using GraphQL.Types;
Expand Down Expand Up @@ -32,7 +33,7 @@ public LineItemType(
var productField = new FieldType
{
Name = "product",
Type = GraphTypeExtenstionHelper.GetActualType<ProductType>(),
Type = GraphTypeExtensionHelper.GetActualType<ProductType>(),
Resolver = new FuncFieldResolver<LineItem, IDataLoaderResult<ExpProduct>>(context =>
{
var includeFields = context.SubFields.Values.GetAllNodesPaths(context).ToArray();
Expand Down Expand Up @@ -178,7 +179,7 @@ public LineItemType(
var vendorField = new FieldType
{
Name = "vendor",
Type = GraphTypeExtenstionHelper.GetActualType<VendorType>(),
Type = GraphTypeExtensionHelper.GetActualType<VendorType>(),
Resolver = new FuncFieldResolver<LineItem, IDataLoaderResult<ExpVendor>>(context =>
{
return dataLoader.LoadVendor(memberService, mapper, loaderKey: "cart_vendor", vendorId: context.Source.VendorId);
Expand Down
2 changes: 1 addition & 1 deletion src/VirtoCommerce.XCart.Core/Schemas/PaymentMethodType.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

namespace VirtoCommerce.XCart.Core.Schemas
{
public class PaymentMethodType : ObjectGraphType<PaymentMethod>
public class PaymentMethodType : ExtendableGraphType<PaymentMethod>
{
public PaymentMethodType()
{
Expand Down
2 changes: 1 addition & 1 deletion src/VirtoCommerce.XCart.Core/Schemas/PaymentType.cs
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ public PaymentType(IMapper mapper, IMemberService memberService, IDataLoaderCont
var vendorField = new FieldType
{
Name = "vendor",
Type = GraphTypeExtenstionHelper.GetActualType<VendorType>(),
Type = GraphTypeExtensionHelper.GetActualType<VendorType>(),
Resolver = new FuncFieldResolver<Payment, IDataLoaderResult<ExpVendor>>(context =>
{
return dataLoader.LoadVendor(memberService, mapper, loaderKey: "cart_vendor", vendorId: context.Source.VendorId);
Expand Down
3 changes: 2 additions & 1 deletion src/VirtoCommerce.XCart.Core/Schemas/ShipmentType.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using System.Linq;
using AutoMapper;
using GraphQL;
using GraphQL.DataLoader;
using GraphQL.Resolvers;
using GraphQL.Types;
Expand Down Expand Up @@ -84,7 +85,7 @@ public ShipmentType(IMapper mapper,
var vendorField = new FieldType
{
Name = "vendor",
Type = GraphTypeExtenstionHelper.GetActualType<VendorType>(),
Type = GraphTypeExtensionHelper.GetActualType<VendorType>(),
Resolver = new FuncFieldResolver<Shipment, IDataLoaderResult<ExpVendor>>(context =>
{
return dataLoader.LoadVendor(memberService, mapper, loaderKey: "cart_vendor", vendorId: context.Source.VendorId);
Expand Down
2 changes: 1 addition & 1 deletion src/VirtoCommerce.XCart.Core/Schemas/ShippingMethodType.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

namespace VirtoCommerce.XCart.Core.Schemas
{
public class ShippingMethodType : ObjectGraphType<ShippingRate>
public class ShippingMethodType : ExtendableGraphType<ShippingRate>
{
public ShippingMethodType()
{
Expand Down
2 changes: 1 addition & 1 deletion src/VirtoCommerce.XCart.Core/Schemas/TaxDetailType.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

namespace VirtoCommerce.XCart.Core.Schemas
{
public class TaxDetailType : ObjectGraphType<TaxDetail>
public class TaxDetailType : ExtendableGraphType<TaxDetail>
{
public TaxDetailType()
{
Expand Down
Loading
Loading