Options for queries. Each query can be made with different options. Settings here take precedence over those in ClientConfiguration.

interface QueryOptions {
    arguments?: QueryArgumentObject;
    format?: ValueFormat;
    linearized?: boolean;
    long_type?: "number" | "bigint";
    max_contention_retries?: number;
    query_tags?: Record<string, string>;
    query_timeout_ms?: number;
    secret?: string;
    traceparent?: string;
    typecheck?: boolean;
}

Properties

Optional arguments. Variables in the query will be initialized to the value associated with an argument key.

format?: ValueFormat

Determines the encoded format expected for the query arguments field, and the data field of a successful response. Overrides the optional setting on the ClientConfiguration.

linearized?: boolean

If true, unconditionally run the query as strictly serialized. This affects read-only transactions. Transactions which write will always be strictly serialized. Overrides the optional setting on the ClientConfiguration.

long_type?: "number" | "bigint"

Controls what Javascript type to deserialize Fauna longs to. Use 'number' to deserialize longs to number. Use 'bigint' to deserialize to bigint. Defaults to 'number'. Note, for extremely large maginitude numbers Javascript's number will lose precision; as Javascript's 'number' can only support +/- 2^53-1 whereas Fauna's long is 64 bit. If this is detected, a warning will be logged to the console and precision loss will occur. If your application uses extremely large magnitude numbers use 'bigint'.

max_contention_retries?: number

The max number of times to retry the query if contention is encountered. Overrides the optional setting on the ClientConfiguration.

query_tags?: Record<string, string>

Tags provided back via logging and telemetry. Overrides the optional setting on the ClientConfiguration.

query_timeout_ms?: number

The timeout to use in this query in milliseconds. Overrides the optional setting on the ClientConfiguration.

secret?: string

Secret to use instead of the client's secret.

traceparent?: string

A traceparent provided back via logging and telemetry. Must match format: https://www.w3.org/TR/trace-context/#traceparent-header Overrides the optional setting on the ClientConfiguration.

typecheck?: boolean

Enable or disable typechecking of the query before evaluation. If no value is provided, the value of typechecked in the database configuration will be used. Overrides the optional setting on the ClientConfiguration.