I have the following mutation type
[MutationType]
public static class FooMutation
{
public static async Task<Guid> CreateFoo(CreateFooCommand request, [FromServices] ICommandBus commandBus) => await commandBus.Send(request);
}
I have the following command (which does not work)
public record CreateFooCommand : ICommand<Guid>;
And I have the following handler
public class CreateFooCommandHandler : ICommandHandler<CreateFooCommand, Guid>
{
public async Task<Guid> Handle(CreateFooCommand command, CancellationToken cancellationToken)
{
var foo = Domain.Foo.Create(userId);
return foo.Id;
}
}
If I do something like the following in the Command, It will works fine
public record CreateFooCommand(string? IDoNotNeedAnyParam) : ICommand<Guid>;
But I do not need any param, and when I remove that param I get:
- InputObject
CreateFooCommandInput
has no fields declared. (GraphQL.Foo.Mapping.RequestTypes.CreateFooInput)
Which should be totally fine by GraphQl standards.
The poor hotchocolate documentation does not tell anything about mutation types without parameters, so I think this should work, but it does not.