I would like to be able to filter subscriptions for some operation based on objects id. For example I would like to do something like this:
subscription{
onTaskCompleted(taskId: "1"){
taskCompleted{
status
items{
reason
iD
}
}
taskFailed{
status
details{
detail
status
}
}
}
}
Where the event would only be emitted if the task with id "1" has completed.
Is there a built in way of doing this with HotChocolate
using some type of filtering?
or
Do I have to add this type of filtering myself, by doing something like this in the resolver:
if(_taskIds.Contains(taskId))
{
TaskCompletedExecution taskFinished = new TaskCompletedExecution(taskCompleted);
await eventSender.SendAsync(nameof(TaskListSubscriptions.OnTaskCompleted), taskFinished,
cancellationToken);
}
Thank you