Resolving IDs with mutation conventions #4641
-
Hello! I'm trying to deserialize an ID in a mutation while using the new Here is the mutation: [UseMutationConvention]
public string ReturnId([ID] int id) => id.ToString(); And the result: {
"errors": [
{
"message": "Unable to convert the value of the argument `id` to `System.Int32`. Check if the requested type is correct or register a custom type converter.",
"locations": [
{
"line": 2,
"column": 3
}
],
"path": [
"returnId"
],
"extensions": {
"fieldName": "returnId",
"argumentName": "id",
"requestedType": "System.Int32"
}
}
]
} When I remove the public record ReturnIdInput([property: ID] int id);
public string ReturnId(ReturnIdInput input) => input.id.ToString(); Am I missing something? Looking at the docs for Input and Payload it seems like this should be supported. Also I want to note how I need to declare the ID as |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
A fix is already in the works in #4639 :) About the property syntax in records: It's the official way to annotate the resulting properties of these "constructor arguments". The solution of v11 was unmaintainable and led to many bugs, as mentioned in the migration guide. |
Beta Was this translation helpful? Give feedback.
A fix is already in the works in #4639 :)
About the property syntax in records: It's the official way to annotate the resulting properties of these "constructor arguments". The solution of v11 was unmaintainable and led to many bugs, as mentioned in the migration guide.