Skip to content

Generates invalid GraphQL schema in HC v15.1.4 #8315

@thomastvedt

Description

@thomastvedt

Product

Hot Chocolate

Version

15.1.4

Link to minimal reproduction

https://github.com/thomastvedt/HotChocolateDictionaryBugReproduction

Steps to reproduce

  • Add a mutation that returns Task
  • Start GraphQL API
  • Generate schema

Example mutation:
https://github.com/thomastvedt/HotChocolateDictionaryBugReproduction/blob/cccc8040441e1646ef20aaf85994a83ff331ebe1/HotChocolateDictionaryBugReproduction/GraphQL/Machines/MachineMutation.cs#L23-L33

What is expected?

In version 15.1.3 HC generated a valid GraphQL schema for this mutation:

[UseMutationConvention]
    public async Task DeleteMachineImage(
        Guid machineId,
        IMachineService machineService,
        IResolverContext context
    )
    {
        var machine = await machineService.GetMachine(machineId);
        await machineService.DeleteImage(machineId);
    }

I would expect this to still produce a valid GraphQL schema?

What is actually happening?

It generates types for Task, which has a AggregateException -> etc. and results in invalid schema. I included an example of the generated GraphQL schema in the readme here:

https://github.com/thomastvedt/HotChocolateDictionaryBugReproduction/blob/main/README.md

Relevant log output

Additional context

Discussion in slack:

https://hotchocolategraphql.slack.com/archives/CD9TNKT8T/p1748379850706879

Metadata

Metadata

Assignees

Type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions