I have a CustomerDetails class:
public record CustomerDetails{
public string? Code { get; init; }
public string? Name { get; init; }
public string? Notes { get; init; }
}
On GraphQL side I have the following:
On queries side:
public class CustomerDetailsGraphType : AutoRegisteringObjectGraphType<CustomerDetails> { }
On mutations side:
public class CustomerDetailsInputGraphType : AutoRegisteringInputObjectGraphType<CustomerDetails> {}
When I run this and try to see the schema into Altair it gives me an error of type:
"message": "GraphQL.Execution.UnhandledError: Error executing document.\r\n ---> System.InvalidOperationException: Unable to register GraphType 'MyProject.Customers.Mutations.ContactDetailsInputGraphType' with the name 'ContactDetails';\nthe name 'ContactDetails' is already registered to 'MyProject.Customers.Query.ContactDetailsGraphType'.\r\n..."
I don't understand why is that happening?