Skip to main content
Guide
Parameters separate request-specific values from the operation tree. A typed request carries parameters and parameter_types, naming the same parameters, so the runtime validates every value before execution and reuses a stable query shape. The SDK helpers on this page send typed requests. Without parameter_types, each value takes its type from its JSON encoding: a whole number that fits in an i64 is an i64, any other number an f64, and strings, booleans, arrays, objects, and null keep their JSON type. Cypher and SQL requests work this way. One request cannot mix typed and untyped parameters.

Define and bind parameters

The Cypher statement reads the same values as $tenant_id and $limit; see Cypher values and parameters. The SQL statement binds the same values as :tenant_id and :limit; with ? placeholders instead, parameters is a list bound in written order. See SQL values and parameters.

Supported parameter families

  • bool
  • i64, f64, and f32
  • string
  • date_time
  • bytes
  • generic property value, which accepts any JSON value
  • object, sent as "object": any object, its fields checked like value
  • an object with declared fields, sent as { "object": { "<field>": "<type>", ... } }; see Typed object fields
  • arrays of any family, sent as { "array": "<element type>" }
  • null or a value of any family, sent as { "nullable": "<type>" }; see Nullable fields
Query JSON cannot represent bytes, and no SDK provides a byte request encoder. Every SDK rejects a bytes parameter with an UnsupportedBytesParameter error when it serializes the request, so bytes parameters cannot currently be sent to POST /v2/query. In Go, ParamDateTime and typed date_time parameters accept helix.DateTime, time.Time, an RFC3339 string, or an int/int64 epoch-millisecond value. The SDK normalizes each value to UTC RFC3339 with millisecond precision. A date_time parameter (or an array of them) is sent as an RFC3339 string and becomes a datetime on the server: UTC epoch milliseconds, with any offset applied and sub-millisecond digits dropped. It is stored, compared, and indexed exactly like a datetime literal or now(), so 2026-06-01T09:00:00+09:00 and 2026-06-01T00:00:00Z are equal and range filters order by instant. Responses render datetimes as YYYY-MM-DDTHH:MM:SS.sssZ, and Cypher and SQL read and render them the same way. Only a declared date_time turns a string into a datetime, including a date_time field of a typed object such as a forEachParam row. An untyped parameter, a value or string parameter, and the fields of a bare object keep RFC3339 text as a string. Before this, date_time parameters were stored as their raw strings. A writer that opens such data converts it once in the background: each property whose every value is a datetime or an RFC3339 string with at most millisecond precision becomes datetimes, and any other property is left as stored and named in the server log. That conversion runs once: rows imported later through a bare object keep their strings, so declare their date_time fields. While it runs, a property holds both forms: a datetime filter skips the rows not converted yet, and a text filter skips the rows already converted.
After the conversion, a Cypher or SQL filter that compares such a property with text matches nothing, because text is never read as a datetime: the comparison is null, with or without an index. This covers string literals (WHERE e.at > '2026-01-01') and every untyped, string or value parameter holding text; a declared date_time parameter is a datetime and compares as one. Read the text as a datetime instead: datetime('…') or datetime($since) in Cypher, and TIMESTAMP '…' or CAST(? AS TIMESTAMP) in SQL.

Typed object fields

An object parameter can declare its fields. Each field is checked and normalized to its own type, recursively, so a date_time field inside array(object{...}) rows, or inside a nested object, binds as a datetime. This is how bulk imports with forEachParam keep their datetimes queryable by typed range filters and range indexes.
  • A declaration names at least one field, each once; { "object": {} } and a repeated field name are rejected when the request is parsed.
  • A value must have the declared fields. A missing field that is not nullable, or an undeclared one (such as a misspelled createdAt), rejects the request, naming the object’s path, for example rows[3]. To accept free-form fields, use a bare object, or declare a field as value.
  • A wrong-typed field, including an invalid RFC3339 string in a date_time field, rejects the request with the field’s path, such as rows[3].createdAt. Nothing is written.
  • null satisfies only a value or nullable field, as for top-level parameters.
  • Parameters count toward the request’s 255-level JSON nesting limit as they are written: the body and its parameters or parameter_types map take 2 levels, each array, object or nullable value level 1, and each declared object level 2 ({ "object": { ... } }), so a declared object nests at most 126 levels. The Rust SDK counts the same levels when it builds a request, so a request it builds also parses.
In Rust, #[query] functions declare this for you: a DateTime inside a ParamObject, ParamValue or BTreeMap<String, DateTime> argument is declared date_time where it sits. One array declares one element type that fits all its elements: a field that is null or omitted in some rows is declared nullable (a datetime one { "nullable": "date_time" }), so rows may differ by omitted keys and each is sent as given, and an empty array fits any element type. Rows that no single type fits, such as a datetime in one row and text in another under the same key, fail with ParameterTypeMismatch naming that field, for example rows[2].at.

Nullable fields

{ "nullable": "<type>" } accepts null or a value of the inner type, normalized as that type. Declare an optional datetime column, such as deletedAt, this way: rows where it is set store a datetime, rows where it is null store null, and rows that omit it leave it unset.
A nullable field may also be omitted from an object. It then stays absent rather than becoming null, so a row stores exactly the fields it has. Every field that is not nullable must be present. In TypeScript an undefined field counts as omitted, as JSON drops it; in Go a nil pointer, map or slice is null, so a *time.Time column works as is.

Query names

query_name is optional diagnostic metadata. It does not create a stored endpoint. Unnamed requests serialize it as null.
Current SDKs do not support stored routes, query registration, or query bundles. Build the request at runtime and send it to POST /v2/query.

Next steps

Writing data

Pass runtime values into create, update, and delete operations.

Reading data

Apply parameters to indexed sources and filters.