When building my GraphQL schema with HotChocolate, I typically use the code first or annotation first approach.
Annotation-based example
Code-first example
In both cases I start from a class where I add multiple methods where each method maps to a different query. But what if I use method overloading and introduce a second implementation of the method using different arguments?
HotChocolate will not complain and you will be able to succesfully run your GraphQL endpoint. However when you look at the generated GraphQL schema only one of the methods is available:
To make this work we need to tell HotChocolate to use a different name for our overloaded method:
Annotation-based example
Code-first example
That should do the trick.