Skip to content

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

@tomachristian

Description

@tomachristian

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) =>
    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);

Metadata

Metadata

Assignees

Type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions