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

Add missed non-nullables to XDigitalCatalog #472

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
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ public virtual async Task<ChildCategoriesQueryResponse> Handle(ChildCategoriesQu
level--;
}

result.ChildCategories = root.ChildCategories ?? new List<ExpCategory>();
result.ChildCategories = root.ChildCategories;

// try resolve products via facets
if (!string.IsNullOrEmpty(request.ProductFilter))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@ namespace VirtoCommerce.XDigitalCatalog.Queries;

public class ChildCategoriesQueryResponse
{
public IList<ExpCategory> ChildCategories { get; set; }
public IList<ExpCategory> ChildCategories { get; set; } = new List<ExpCategory>();
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ public class ChildCategoriesQueryResponseType : ExtendableGraphType<ChildCategor
{
public ChildCategoriesQueryResponseType()
{
Field<ListGraphType<CategoryType>>(
Field<NonNullGraphType<ListGraphType<NonNullGraphType<CategoryType>>>>(
asvishnyakov marked this conversation as resolved.
Show resolved Hide resolved
nameof(ChildCategoriesQueryResponse.ChildCategories),
resolve: context => context.Source.ChildCategories);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ public class ProductSuggestionsQueryResponseType : ExtendableGraphType<ProductSu
{
public ProductSuggestionsQueryResponseType()
{
Field<ListGraphType<StringGraphType>>(
Field<NonNullGraphType<ListGraphType<NonNullGraphType<StringGraphType>>>>(
nameof(ProductSuggestionsQueryResponse.Suggestions),
resolve: context => context.Source.Suggestions);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -840,7 +840,7 @@ public void Build(ISchema schema)
/// }
/// }
/// </example>
var validateCouponField = FieldBuilder.Create<CartAggregate, bool>(typeof(BooleanGraphType))
var validateCouponField = FieldBuilder.Create<CartAggregate, bool>(typeof(NonNullGraphType<BooleanGraphType>))
.Name("validateCoupon")
.Argument(GraphTypeExtenstionHelper.GetActualComplexType<NonNullGraphType<InputValidateCouponType>>(), _commandName)
.ResolveSynchronizedAsync(CartPrefix, "userId", _distributedLockService, async context =>
Expand Down
Loading