graphql-platform
graphql-platform copied to clipboard
Using IdOperationFilterInputType as field filter type gives error when filtering
Product
Hot Chocolate
Version
14.3.0
Link to minimal reproduction
https://github.com/dalen/hotchocolate-reproduction/tree/main/HotChocolateIdFilter
Steps to reproduce
On a filter input type set the filter for a field to .Type<IdOperationFilterInputType>() to make the filter use ID for the field instead of something like Int. Then try to query it.
{
books(where: {
id: {
eq: 1
}
}) {
nodes {
id
title
}
}
}
Response
{
"errors": [
{
"message": "The node ID string has an invalid format.",
"locations": [
{
"line": 2,
"column": 3
}
],
"path": [
"books"
],
"extensions": {
"originalValue": "1"
}
}
],
"data": {
"books": null
}
}
What is expected?
Expect the filtering to work and convert the ID to the underlying type, just like if you set an attribute to use IdType.
What is actually happening?
Instead I get the above error.
Relevant log output
Additional context
Using id: { eq: "1"} with the ID as a string makes no difference.
The error message here is the same as in https://github.com/ChilliCream/graphql-platform/issues/7346
But it seems like a separate (or wider) issue.
I ran into this as well, I think the problem is that IdOperationFilterInputType is still trying to deserialize even if you haven't enabled Relay support via AddGlobalObjectIdentification()