-
-
Notifications
You must be signed in to change notification settings - Fork 792
Open
Description
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);