kriti-lang
kriti-lang copied to clipboard
How to return nothing in else condition?
I am trying to generate an Elastic search payload using Hasura Rest transformers.
Is there a way to return nothing in the {{else}}
condition? I tried using {{end}}
directly as I don't need an {{else}}
but the parser fails. I also tried to use void
but it also fails to parse.
Here is what I am trying to do:
{
"query": {
"bool": {
"must": [
{{if $body?.input?.search != null }}
{
"match": {
"content.text": "{{$body?.input?.search}}"
}
}
{{else}}
void
{{end}}
]
}
}
}
Hi. Sorry for the slow response time!
We have some standard library functions in the Kriti repo which would resolve this issue for you, but they aren't made available in HGE. I'm looking into how we can correct this now.
Hi! Is there a solution to the issue now? :)