Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using IdOperationFilterInputType as field filter type gives error when filtering #7855

Open
dalen opened this issue Dec 20, 2024 · 1 comment

Comments

@dalen
Copy link

dalen commented Dec 20, 2024

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.

@dalen
Copy link
Author

dalen commented Dec 20, 2024

The error message here is the same as in #7346

But it seems like a separate (or wider) issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant