Baike.dev
All toolsAI codingTrendingOpen sourceNewsSubmit
Log in
Back to tool/Back to issues
#10847·graphql-engine

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:

yaml
# 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:

  1. query_params as object → Can't have duplicate keys (can't send properties= twice)
  2. query_params as string with $body.input.data.properties[0] → Only gets first element, loses second value for [WANT, OWN]
  3. Optional chaining ?. in query params → Throws "Invalid Lexeme" error (see #9130)
  4. {{$body.input.data?.properties ?? []}} → Also fails with the same error

Version: Hasura v2.46.0

Source: hasura/graphql-engine

View original on GitHubView discussion on GitHub