diff --git a/src/HotChocolate/Core/test/Types.Mutations.Tests/Issue6605ReproTests.cs b/src/HotChocolate/Core/test/Types.Mutations.Tests/Issue6605ReproTests.cs index aa8f6cee6d5..a40de4d09d9 100644 --- a/src/HotChocolate/Core/test/Types.Mutations.Tests/Issue6605ReproTests.cs +++ b/src/HotChocolate/Core/test/Types.Mutations.Tests/Issue6605ReproTests.cs @@ -10,16 +10,16 @@ public class Issue6605ReproTests [Fact] public async Task Mutation_Error_Type_With_Int_Field_Should_Not_Fail_Schema_Build() { - var exception = await Record.ExceptionAsync(async () => + var schema = await new ServiceCollection() .AddGraphQL() .AddQueryType() .AddMutationType() .AddMutationConventions() .AddMutationErrorConfiguration() - .BuildSchemaAsync()); + .BuildSchemaAsync(); - Assert.Null(exception); + schema.MatchSnapshot(); } public class CustomErrorConfig : MutationErrorConfiguration diff --git a/src/HotChocolate/Core/test/Types.Mutations.Tests/__snapshots__/Issue6605ReproTests.Mutation_Error_Type_With_Int_Field_Should_Not_Fail_Schema_Build.graphql b/src/HotChocolate/Core/test/Types.Mutations.Tests/__snapshots__/Issue6605ReproTests.Mutation_Error_Type_With_Int_Field_Should_Not_Fail_Schema_Build.graphql new file mode 100644 index 00000000000..5b256088a69 --- /dev/null +++ b/src/HotChocolate/Core/test/Types.Mutations.Tests/__snapshots__/Issue6605ReproTests.Mutation_Error_Type_With_Int_Field_Should_Not_Fail_Schema_Build.graphql @@ -0,0 +1,32 @@ +schema { + query: Query + mutation: Mutation +} + +interface Error { + message: String! +} + +type AddFooPayload { + foo: Foo + errors: [AddFooError!] +} + +type CustomError implements Error { + errorCode: Int! + message: String! +} + +type Foo { + bar: String! +} + +type Mutation { + addFoo: AddFooPayload! +} + +type Query { + foo: Foo! +} + +union AddFooError = CustomError