My Products
Help

Filter: _is_null AND _is_not_null

by David Tandberg-Johansen

Hi,

 

Trying to figure out the filter operators _is_null AND _is_not_null 

They demand a value, but i can't figure out what the value should be.

I see in the schema documentation that there are different *_FilterClause._is_null for the different datatypes. If someone could examplify i would appreciate it

 

 

2 REPLIES 2

by David Tandberg-Johansen

Hi @Marius Bancila

 

Thank you for explaining the use 

Accepted solution
Marius Bancila
VISMA

by Marius Bancila (Updated ‎07-11-2023 16:36 by Marius Bancila VISMA )

The operators _is_null and _is_not_null are mainly intended for BLOB columns because the others are typically not allowed to be null.

 

Since BLOBs are represented as base64-encoded strings, the type expected for these operators is String. However, of course, you're not supposed to pass any actual value, just something that's going to be ignored, such a an empty string:

 

 

query read_orders_attachments($cid : Int)
{
	useCompany(no: $cid)
  {
  	orderAttachment(filter :{fileData : {_is_null : ""}})
    {
      items
      {
        orderNo
        fileNo
        fileType
        fileData
      }
    }
  }
}

However, running this query will raise the following error:

"Unknown data type for column with id 16526."

We will release a fix for this issue.