Field ignored if it has the same method name as another field
Hi,
the current versions can't seem to handle something like this:
[Name("getItem")
public object getItem(string id)
{
...
}
[Name("getItemByIdAndPath")
public object getItem(string id, string path)
{
...
}
In this case, we get this error:
Cannot query field "getItemByIdAndPath" on type "Query"
It seems it just gets ignored while parsing and doesn't exist.
Luckily, we only had one occurrence of this, and the fix is easy. But still, you should probably be made aware of this.
GraphQL: 8.2.1 GraphQL.Server.Transports.AspNetCore: 8.2.0 GraphQL.Convetions: 8.0.0
I don’t think the conventions project was ever made to be compatible with GraphQL.NET’s attributes for its type-first definitions. You might check that you’re referencing GraphQL.Comventions.NameAttribute and not GraphQL.NameAttribute.
Yeah, the NameAttribute from the main GraphQL namespace has never worked, these are all definitely the ones from the GraphQL.Conventions namespace.
And this exact setup worked before I updated the packages. I just noticed that I didn't make this clear in this issue. Not sure if you noticed that I'm the same guy from the other two recent issues ^^.
These were the previous versions: GraphQL: 7.2.0 GraphQL.Server.Transports.AspNetCore: 7.1.1 GraphQL.Convetions: 7.0.0
So I'm pretty sure in saying this is a new problem. And, like I said, the workaround is simple, so I don't really need you this fix this. But it should be mentioned somewhere. At least as far I could see, the Conventions project doesn't have a migration guide?
There's been hardly any changes since v4; just a couple bug fixes. I've tried to assist making the minimal changes to keep the repository to compile with the latest versions. As such, it shouldn't need a migration guide. Any changes are probably unintentional and/or bugs.
There's a whole bunch of tests to ensure that the [Name] attribute works correctly, and all tests pass with GraphQL.NET 8, so I really don't know what the problem would be.
If you can write a code snippet which reproduces the problem, then perhaps @tlil or I can investigate further.