Having trouble with $filter 'A binary operator with incompatible types was detected.'

I’m currently trialling Squidex and i’ve hit a stumbling block with $filter. I’m getting the following response:

{
  "message": "Query $filter clause not valid.",
  "details": [
    "A binary operator with incompatible types was detected. Found operand types 'Squidex.ProductSlugProperty' and 'Edm.String' for operator kind 'Equal'."
  ],
  "statusCode": 400
}

My filter looks like this

data/slug eq 'e-ranger'

Schema looks like this

{
    "fields": [
        {
            "name": "Categories",
            "properties": {
                "editor": "Default",
                "isRequired": true,
                "fieldType": "References",
                "schemaId": "59b03bd9-6c87-497e-99f6-3d69a154ebb4",
                "label": "Product Categories"
            },
            "partitioning": "invariant"
        },
        {
            "name": "ProductName",
            "properties": {
                "editor": "Input",
                "isListField": true,
                "fieldType": "String",
                "label": "Product Name"
            },
            "partitioning": "language"
        },
        {
            "name": "slug",
            "properties": {
                "editor": "Slug",
                "isRequired": true,
                "fieldType": "String",
                "inlineEditable": true,
                "pattern": "^[a-z0-9]+(\\-[a-z0-9]+)*$"
            },
            "partitioning": "invariant"
        },
        {
            "name": "ProductDescription",
            "properties": {
                "editor": "RichText",
                "fieldType": "String",
                "label": "Product Description"
            },
            "partitioning": "language"
        },
        {
            "name": "TechnicalSpecifications",
            "properties": {
                "editor": "RichText",
                "fieldType": "String",
                "label": "Technical Specifications"
            },
            "partitioning": "language"
        },
        {
            "name": "MainProductImage",
            "properties": {
                "editor": "Default",
                "fieldType": "Assets",
                "maxItems": 1,
                "mustBeImage": true,
                "label": "Main Product Image"
            },
            "partitioning": "invariant"
        },
        {
            "name": "ProductImages",
            "properties": {
                "editor": "Default",
                "fieldType": "Assets",
                "maxItems": 10,
                "mustBeImage": true
            },
            "partitioning": "invariant"
        }
    ],
    "properties": {}
}

This doesn’t make any sense to me, I can use eq on the ProductName property but not on the slug property. Am I missing something here?

Thanks In Advance

Dean

$filter=data/slug/iv eq 'e-ranger' should work for you. There is no shortcut for non-localized fields yet but I am actually reworking the query system and it should be possible to implement that.

1 Like

Thanks Sebastian that works!