Skip to content

Commit

Permalink
Expose media text in GraphQL query (#15945)
Browse files Browse the repository at this point in the history
  • Loading branch information
rpedu committed May 2, 2024
1 parent d3e6b32 commit 0168664
Showing 1 changed file with 12 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,18 @@ public MediaFieldQueryObjectType()
var mediaFileStore = x.RequestServices.GetService<IMediaFileStore>();
return paths.Select(p => mediaFileStore.MapPathToPublicUrl(p));
});

Field<ListGraphType<StringGraphType>, IEnumerable<string>>("mediatexts")
.Description("the media texts")
.PagingArguments()
.Resolve(x =>
{
if (x.Source?.MediaTexts is null)
{
return Array.Empty<string>();
}
return x.Page(x.Source.MediaTexts);
});
}
}
}

0 comments on commit 0168664

Please sign in to comment.