Skip to content

Commit

Permalink
Fix graphql concurrency issue with ContentPickerFiled
Browse files Browse the repository at this point in the history
  • Loading branch information
sebastienros committed Apr 11, 2024
1 parent 112c0d4 commit 81a9518
Showing 1 changed file with 4 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,13 @@ public ContentPickerFieldQueryObjectType()
Field<ListGraphType<ContentItemInterface>, IEnumerable<ContentItem>>("contentItems")
.Description("the content items")
.PagingArguments()
.ResolveAsync(x =>
.ResolveLockedAsync(async x =>
{
var contentItemLoader = x.GetOrAddPublishedContentItemByIdDataLoader();
return (contentItemLoader.LoadAsync(x.Page(x.Source.ContentItemIds))).Then(itemResultSet =>
{
return itemResultSet.SelectMany(x => x);
});
var data = await contentItemLoader.LoadAsync(x.Page(x.Source.ContentItemIds)).GetResultAsync();
return data.SelectMany(x => x);
});
}
}
Expand Down

0 comments on commit 81a9518

Please sign in to comment.