-
-
Notifications
You must be signed in to change notification settings - Fork 798
Open
Labels
Area: RelayIssue is related to the Relay integrationIssue is related to the Relay integration🌶️ hot chocolate🙋 good first issueGood for newcomersGood for newcomers
Milestone
Description
Is there an existing issue for this?
- I have searched the existing issues
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
userIdfound on the fieldnode.
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
idand 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
serialfound on the fieldnode.
Relevant log output
No response
Additional Context?
No response
Product
Hot Chocolate
Version
12.4.0-preview.14
Metadata
Metadata
Assignees
Labels
Area: RelayIssue is related to the Relay integrationIssue is related to the Relay integration🌶️ hot chocolate🙋 good first issueGood for newcomersGood for newcomers