Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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<Query>()
.AddMutationType<Mutation>()
.AddMutationConventions()
.AddMutationErrorConfiguration<CustomErrorConfig>()
.BuildSchemaAsync());
.BuildSchemaAsync();

Assert.Null(exception);
schema.MatchSnapshot();
}

public class CustomErrorConfig : MutationErrorConfiguration
Expand Down
Original file line number Diff line number Diff line change
@@ -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
Loading