Hi, I am trying to fetch Functions where data.type: "RULE"
is set. But If I run the query, I get Null type warning with suggestion to use ‘!’ or ‘?’, but when using either, I still get the same error.
code →
Function.where(.data.type == 'RULE')
error →
error: Type `Null` does not have field `type`
at *query*:1:22
|
1 | Function.where(.data.type == 'RULE')
| ^^^^
|
hint: Use the ! or ?. operator to handle the null case
|
1 | Function.where(.data!.type == 'RULE')
| +
|
code →
Function.where(.data!.type == 'RULE')
error →
error: Type `Null` does not have field `type`
at *query*:1:23
|
1 | Function.where(.data!.type == 'RULE')
| ^^^^
|
hint: Use the ! or ?. operator to handle the null case
|
1 | Function.where(.data!!.type == 'RULE')
| +
|
code →
Function.where(.data?.type == 'RULE')
error →
error: Type `Null` does not have field `type`
at *query*:1:23
|
1 | Function.where(.data?.type == 'RULE')
| ^^^^
|
hint: Use the ! or ?. operator to handle the null case
|
1 | Function.where(.data!?.type == 'RULE')
| +
|