Nullable Filter Parameter, several Query Definitions for Filter Permutations?

Nullable Parameters?
Query Definition:
getCurrentVertraegeType(hik: Int!, stichtag: DueDate!, vertragstype: ID ): [Vertrag]
@bb_resolver(
_type: SELECT,
_object: Vertrag,
_filter: { hik: { _eq: “$hik” }, gueltigbis: { _gte: “$stichtag” }, vertragstype: { id: { _eq: “$vertragstype” } } })

If I provide all three parameters, the query works fine. The Vertragstype parameter filter correctly by the sub type.
• But I have found no way to set any parameter to null. So when I do not want to filter over the parameter hik I have to build another query?
• The same, when I do not want to filter by vertragstype?

1 Like

Hi Kai-Uwe,

When you send a request for this query, you would just need to leave out the vertranstype parameter from the query. It will then leave out that part of the filter.

Unfortunately not. I get the error:
“Database returned error: Failed to prepare query: Error { kind: Db, cause: Some(DbError { severity: "ERROR", parsed_severity: Some(Error), code: SqlState(E22P02), message: "invalid input syntax for type uuid: \"$vertragstype\"", detail: None, hint: None, position: Some(Original(931)), where_: None, schema: None, table: None, column: None, datatype: None, constraint: None, file: Some("uuid.c"), line: Some(133), routine: Some("string_to_uuid") }) }”

That is my input:
{ getCurrentVertraegeType(hik: 123456789, stichtag: “2024-05-08”) {
name,
description
}
}

Ok, I’ll have a look at this and the other three questions you’ve raised.

Hi Kai-Uwe, apologies for taking so long to come back to you on your questions. We have been busy to get out a new version with a few changes including support for buckets (e.g. AWS S3) / images uploads. Once this is done and released (Markus is currently out sick this week but we hope to release early next week) we will also work on the this question of nullable arguments. Currently, with arguments, it’s only currently inserts and updates that have nullable arguements like this. But we will add it for selects in the release after the next one.