Request transform query_params string doesn't support Kriti range/concat for arrays with empty values
Author: afranioceCreated Jun 10, 2026Updated Jun 10, 2026
Problem Statement:
When using query_params as a string with Kriti templates to convert an array into repeated query parameters (e.g., ?properties=WANT&properties=OWN), the template works for arrays with 1+ elements but fails with empty arrays ([]).
Current Behavior:
# This template (from #7911):
query_params: '{{ concat([concat({{ range _, x := $body.input.data.properties }} "properties={{x}}&" {{ end }}), "profile_id={{$body.input.data.profile_id}}"]) }}'- ✅
[WANT, OWN]→?properties=WANT&properties=OWN&profile_id=prof1 - ✅
[OWN]→?properties=OWN&profile_id=prof1 - ❌
[]→Error: parsing Nested Object failed, expected Object, but encountered Array
Expected Behavior:
When the array is empty (or the field is optional/not provided), the properties params should be omitted from the query string. The concat function with an empty array returns [] instead of an empty string, which breaks the query string construction.
Related Issues:
- #7911 - Added support for array transforms with
concat/range, but doesn't handle empty arrays - #9130 - Optional chaining
?.in query params throws "Invalid Lexeme" error
Alternative approaches tried:
query_paramsas object → Can't have duplicate keys (can't sendproperties=twice)query_paramsas string with$body.input.data.properties[0]→ Only gets first element, loses second value for[WANT, OWN]- Optional chaining
?.in query params → Throws "Invalid Lexeme" error (see #9130) {{$body.input.data?.properties ?? []}}→ Also fails with the same error
Version: Hasura v2.46.0
Source: hasura/graphql-engine