ChilliCream / ChilliCream/graphql-platform
Add PagingQueryableExtensions for Marten
Nobody has claimed this yet.
- Dominant language
- C#
- Stars
- 5.8k
- Forks
- 810
- Avg merge
- 15h 39m
- Merged PRs (30d)
- 98
Description
Product
Green Donut
Is your feature request related to a problem?
Currently there is no support for ToPageAsync extension method's when using Hotchocolate.Data.Marten.
Existing EntityFrameworkCore version
public class GetBrandQueryHandler(CatalogContext context)
: IRequestHandler<GetBrandsQuery, Page<Brand>>
{
public async Task<Page<Brand>> Handle(
GetBrandsQuery request,
CancellationToken cancellationToken)
=> await context.Brands
.With(request.Query, s => s.AddAscending(t => t.Id))
.ToPageAsync(request.PagingArguments, cancellationToken);
}
The solution you'd like
I would like to implement it so that it has the same signature as Hotchocolate.Data.EntityFrameworkCore.
Marten (not implemented)
public class GetBrandQueryHandler(IDocumentSession session)
: IRequestHandler<GetBrandsQuery, Page<Brand>>
{
public async Task<Page<Brand>> Handle(
GetBrandsQuery request,
CancellationToken cancellationToken)
=> await session.Query<Brand>()
.With(request.Query, s => s.AddAscending(t => t.Id))
.ToPageAsync(request.PagingArguments, cancellationToken);
}
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by locating the existing HotChocolate.Data.EntityFrameworkCore ToPageAsync implementation and the Marten integration entry points. Compare their paging signatures and behavior with the handler examples in this issue, then add the corresponding Marten extension and verify that the shown session.Query() usage supports the same PagingArguments and cancellation token.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp
- Domain
- api, backend
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 55/100