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

Fix/error when querying nested content items with list part #14916

Merged
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 @@ -6,6 +6,7 @@
using GraphQL.Types;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Localization;
using OrchardCore.Apis.GraphQL;
using OrchardCore.ContentManagement;
using OrchardCore.ContentManagement.GraphQL.Queries.Types;
using OrchardCore.ContentManagement.Records;
Expand All @@ -28,7 +29,8 @@ public ListQueryObjectType(IStringLocalizer<ListQueryObjectType> S)
.Description("the content items")
.Argument<IntGraphType, int>("first", "the first n elements (10 by default)", 10)
.Argument<IntGraphType, int>("skip", "the number of elements to skip", 0)
.ResolveAsync(async g =>
// Important to use ResolveLockedAsync to prevent concurrency error on database query, when using nested content items with List part
.ResolveLockedAsync(async g =>
{
var serviceProvider = g.RequestServices;
var session = serviceProvider.GetService<ISession>();
Expand Down