ChilliCream / ChilliCream/graphql-platform

Add PagingQueryableExtensions for Marten

Open
#8,251 2 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

🌶️ green donut Area: GreenDonut.Data
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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.