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

Able to use [NodeResolver] and [Query] on the same resolver method #8057

Open
tomachristian opened this issue Feb 21, 2025 · 0 comments
Open

Comments

@tomachristian
Copy link

Product

Hot Chocolate

Is your feature request related to a problem?

We should be able to combine these:

[NodeResolver]
public static Task<Draft?> Get(
    OrganisationWorkflowDraftId id,
    QueryContext<Draft> queryContext,
    IDraftByIdDataLoader draftByIdDataLoader,
    CancellationToken cancellationToken) =>
    GetDraft(id, queryContext, draftByIdDataLoader, cancellationToken);

[Query]
public static Task<Draft?> GetDraft(
    [ID(TypeName)] OrganisationWorkflowDraftId id,
    QueryContext<Draft> queryContext,
    IDraftByIdDataLoader draftByIdDataLoader,
    CancellationToken cancellationToken,
    IResolverContext ctx = null!) =>
    draftByIdDataLoader
        .With(queryContext)
        .LoadAsync(id.WorkflowId, cancellationToken);

The solution you'd like

[NodeResolver]
[Query]
public static Task<Draft?> GetDraft(
    OrganisationWorkflowDraftId id,
    QueryContext<Draft> queryContext,
    IDraftByIdDataLoader draftByIdDataLoader,
    CancellationToken cancellationToken) =>
    GetDraft(id, queryContext, draftByIdDataLoader, cancellationToken);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant