Is there an existing issue for this?
Describe the bug
When creating a node resolver you might want to use something like userId as the parameter name of the node resolver, i.e.
[Node]
[ExtendObjectType(typeof(User))]
public class UserNode
{
[NodeResolver]
public User GetUserAsync(int userId)
{
// ...
}
}
Currently this will fail with the following error, if you issue a query with node(id: "..."):
There was no argument with the name userId found on the field node.
I think we should either:
- Just inject the Id value in the first field, if it has the correct type
- We leave it like is, document that it has to be called
id and improve the error message to point to the issue
Steps to reproduce
- Create a simple model + type extension
public class Model
{
public long Id { get; set; } = 123;
}
[Node]
[ExtendObjectType(typeof(Model))]
public class ModelNode
{
[NodeResolver]
public Model GetModelAsync(long serial)
{
// ...
}
}
- Issue a query like the following
{
node(id: "TW9kZWwKbDEyMw==") {
id
}
}
- You receive the following error:
There was no argument with the name serial found on the field node.
Relevant log output
No response
Additional Context?
No response
Product
Hot Chocolate
Version
12.4.0-preview.14
Is there an existing issue for this?
Describe the bug
When creating a node resolver you might want to use something like
userIdas the parameter name of the node resolver, i.e.Currently this will fail with the following error, if you issue a query with
node(id: "..."):I think we should either:
idand improve the error message to point to the issueSteps to reproduce
{ node(id: "TW9kZWwKbDEyMw==") { id } }Relevant log output
No response
Additional Context?
No response
Product
Hot Chocolate
Version
12.4.0-preview.14