QueryManagerOptions<F, O, C>
Defined in: packages/core/src/utils/QueryManager.ts:174
Options for QueryManager. Mirrors the subset of QueryBuilder props that affect query structure rather than rendering, so the same configuration objects can drive both.
Type Parameters
| Type Parameter | Default type |
|---|---|
F extends FullField | FullField |
O extends FullOperator | FullOperator |
C extends FullCombinator | FullCombinator |
Properties
addRuleToNewGroups?
optionaladdRuleToNewGroups?:boolean
Defined in: packages/core/src/utils/QueryManager.ts:241
When true, groups created by QueryManager.createRuleGroup contain one new rule.
autoSelectField?
optionalautoSelectField?:boolean
Defined in: packages/core/src/utils/QueryManager.ts:192
When false, an empty placeholder option is prepended to the field list.
autoSelectOperator?
optionalautoSelectOperator?:boolean
Defined in: packages/core/src/utils/QueryManager.ts:194
When false, an empty placeholder option is prepended to each operator list.
autoSelectValue?
optionalautoSelectValue?:boolean
Defined in: packages/core/src/utils/QueryManager.ts:196
When false, an empty placeholder option is prepended to each value list.
baseCombinator?
optionalbaseCombinator?:Record<string,unknown>
Defined in: packages/core/src/utils/QueryManager.ts:190
Properties applied to every combinator in combinators.
baseField?
optionalbaseField?:Record<string,unknown>
Defined in: packages/core/src/utils/QueryManager.ts:186
Properties applied to every field in fields.
baseOperator?
optionalbaseOperator?:Record<string,unknown>
Defined in: packages/core/src/utils/QueryManager.ts:188
Properties applied to every operator in operators.
combinators?
optionalcombinators?:FlexibleOptionListProp<C> |BaseOptionMap<C>
Defined in: packages/core/src/utils/QueryManager.ts:184
The combinators available for groups. Defaults to defaultCombinators.
disabledPaths?
optionaldisabledPaths?:Path[]
Defined in: packages/core/src/utils/QueryManager.ts:273
Paths that are disabled without the corresponding rule or group carrying a disabled
property. This mirrors the array form of the QueryBuilder disabled prop
(e.g. disabled={[[2]]}), which disables nodes by position rather than by data.
A path is treated as disabled if it appears here or descends from a path that does. Honored
only when respectDisabled is true; as with the disabled property, a node's own
disabled can always be changed so it is never permanently locked.
fields?
optionalfields?:FlexibleOptionListProp<F> |BaseOptionMap<F>
Defined in: packages/core/src/utils/QueryManager.ts:180
The fields available for rules. Accepts the same shapes as the fields prop.
freeze?
optionalfreeze?:boolean
Defined in: packages/core/src/utils/QueryManager.ts:309
Deep-freeze everything the manager hands out—the query, the field list, the field map, and
the combinator list—so accidental mutation throws in strict mode. Defaults to true.
Pass false when the manager's output is handed to a framework that wraps objects in
proxies (Vue reactive, Solid stores) or otherwise needs to mutate them. This also disables
immer's auto-freeze for mutations made through the manager.
The shallow copy returned by QueryManager.getOptions is frozen either way: it is a one-level copy that no framework proxy is placed inside, so freezing it costs nothing and still prevents callers from mutating the options snapshot they were handed.
getDefaultField?
optionalgetDefaultField?:DefaultFieldProp<F>
Defined in: packages/core/src/utils/QueryManager.ts:206
The default field for rules created by QueryManager.createRule.
getDefaultOperator?
optionalgetDefaultOperator?:DefaultOperatorProp<F>
Defined in: packages/core/src/utils/QueryManager.ts:208
The default operator for a given field.
getDefaultValue?
optionalgetDefaultValue?: (rule:RuleType,misc: {fieldData:F; }) =>unknown
Defined in: packages/core/src/utils/QueryManager.ts:210
Overrides the computed default value for a new rule.
Parameters
| Parameter | Type |
|---|---|
rule | RuleType |
misc | { fieldData: F; } |
misc.fieldData | F |
Returns
unknown
getInputType?
optionalgetInputType?: (field:string,operator:string,misc: {fieldData:F; }) =>InputType|null
Defined in: packages/core/src/utils/QueryManager.ts:277
The input type for a given field/operator, surfaced by QueryManager.getRuleContext.
Parameters
| Parameter | Type |
|---|---|
field | string |
operator | string |
misc | { fieldData: F; } |
misc.fieldData | F |
Returns
InputType | null
getMatchModes?
optionalgetMatchModes?: (field:string,misc: {fieldData:F; }) =>boolean|MatchMode[] |FlexibleOption<MatchMode>[]
Defined in: packages/core/src/utils/QueryManager.ts:228
The valid match modes for a given field.
Parameters
| Parameter | Type |
|---|---|
field | string |
misc | { fieldData: F; } |
misc.fieldData | F |
Returns
boolean | MatchMode[] | FlexibleOption<MatchMode>[]
getOperators?
optionalgetOperators?: (field:string,misc: {fieldData:F; }) =>FlexibleOptionList<O> |null
Defined in: packages/core/src/utils/QueryManager.ts:212
The operators available for a given field.
Parameters
| Parameter | Type |
|---|---|
field | string |
misc | { fieldData: F; } |
misc.fieldData | F |
Returns
FlexibleOptionList<O> | null
getParameters?
optionalgetParameters?: (field:string,operator:string,misc: {fieldData:F; }) =>FlexibleOptionList<{[key:string]:unknown;disabled?:boolean;label:string;name:string;value?:string; }> |null
Defined in: packages/core/src/utils/QueryManager.ts:233
The named parameters available for a given field/operator.
Parameters
| Parameter | Type |
|---|---|
field | string |
operator | string |
misc | { fieldData: F; } |
misc.fieldData | F |
Returns
FlexibleOptionList<{[key: string]: unknown; disabled?: boolean; label: string; name: string; value?: string; }> | null
getSubQueryBuilderProps?
optionalgetSubQueryBuilderProps?: (field:string,misc: {fieldData:F; }) =>Record<string,unknown>
Defined in: packages/core/src/utils/QueryManager.ts:279
Extra props for a subquery builder, surfaced by QueryManager.getRuleContext.
Parameters
| Parameter | Type |
|---|---|
field | string |
misc | { fieldData: F; } |
misc.fieldData | F |
Returns
Record<string, unknown>
getValueEditorType?
optionalgetValueEditorType?: (field:string,operator:string,misc: {fieldData:F; }) =>ValueEditorType
Defined in: packages/core/src/utils/QueryManager.ts:214
The value editor type for a given field/operator, which informs the default value.
Parameters
| Parameter | Type |
|---|---|
field | string |
operator | string |
misc | { fieldData: F; } |
misc.fieldData | F |
Returns
getValues?
optionalgetValues?: (field:string,operator:string,misc: {fieldData:F; }) =>FlexibleOptionList<{[key:string]:unknown;disabled?:boolean;label:string;name:string;value?:string; }>
Defined in: packages/core/src/utils/QueryManager.ts:216
The value list for a given field/operator, which informs the default value.
Parameters
| Parameter | Type |
|---|---|
field | string |
operator | string |
misc | { fieldData: F; } |
misc.fieldData | F |
Returns
FlexibleOptionList<{[key: string]: unknown; disabled?: boolean; label: string; name: string; value?: string; }>
getValueSources?
optionalgetValueSources?: (field:string,operator:string,misc: {fieldData:F; }) =>ValueSources| [FlexibleOption,...FlexibleOption[]]
Defined in: packages/core/src/utils/QueryManager.ts:222
The valid value sources for a given field/operator.
Parameters
| Parameter | Type |
|---|---|
field | string |
operator | string |
misc | { fieldData: F; } |
misc.fieldData | F |
Returns
ValueSources | [FlexibleOption, ...FlexibleOption[]]
history?
optionalhistory?:boolean|QueryHistoryOptions
Defined in: packages/core/src/utils/QueryManager.ts:285
Enables undo/redo recording. Pass true for the defaults, or an object to configure
maxHistory and/or coalesceMs. Disabled by default, so instances that never undo
retain no extra references.
idGenerator?
optionalidGenerator?: () =>string
Defined in: packages/core/src/utils/QueryManager.ts:313
Generates id properties for new rules and groups. Defaults to generateID.
Returns
string
listsAsArrays?
optionallistsAsArrays?:boolean
Defined in: packages/core/src/utils/QueryManager.ts:239
When true, multi-value defaults are arrays instead of comma-joined strings.
maxLevels?
optionalmaxLevels?:number
Defined in: packages/core/src/utils/QueryManager.ts:256
The maximum depth at which groups may be added. As with the QueryBuilder prop of the same
name, a non-positive value means unlimited. Defaults to Infinity.
now?
optionalnow?: () =>number
Defined in: packages/core/src/utils/QueryManager.ts:320
Internal
Clock used to time history coalescing. Defaults to Date.now.
Test seam. Exists so that history recording can be compared against the
react-querybuilder/history implementation without depending on wall-clock timing.
Returns
number
onInvalidTarget?
optionalonInvalidTarget?: (info:AbortInfo) =>void
Defined in: packages/core/src/utils/QueryManager.ts:296
Called whenever a mutation is aborted, including for the non-error reasons
"same-location" and "no-change". Can be overridden per call.
Parameters
| Parameter | Type |
|---|---|
info | AbortInfo |
Returns
void
operators?
optionaloperators?:FlexibleOptionListProp<O> |BaseOptionMap<O>
Defined in: packages/core/src/utils/QueryManager.ts:182
The operators available for rules. Accepts the same shapes as the operators prop.
queryDisabled?
optionalqueryDisabled?:boolean
Defined in: packages/core/src/utils/QueryManager.ts:275
Abort every mutation, as though the entire query were disabled. Defaults to false.
resetOnFieldChange?
optionalresetOnFieldChange?:boolean
Defined in: packages/core/src/utils/QueryManager.ts:246
When updating a rule's field, reset its operator, value, and valueSource to their
defaults. Defaults to true, matching the QueryBuilder prop of the same name.
resetOnOperatorChange?
optionalresetOnOperatorChange?:boolean
Defined in: packages/core/src/utils/QueryManager.ts:251
When updating a rule's operator, reset its value to the default. Defaults to false,
matching the QueryBuilder prop of the same name.
respectDisabled?
optionalrespectDisabled?:boolean
Defined in: packages/core/src/utils/QueryManager.ts:263
Honor disabled properties within the query, so mutations targeting a disabled rule or
group (or a descendant of a disabled group) are aborted. Updating a node's own disabled
property is always permitted. Defaults to true, matching the QueryBuilder component;
pass false to mutate freely regardless of the property.
strict?
optionalstrict?:boolean
Defined in: packages/core/src/utils/QueryManager.ts:291
Throw a QueryManagerError when a mutation is aborted because its target could not be used. Disabled by default, in which case such mutations are silent no-ops. Can be overridden per call.
translations?
optionaltranslations?:Partial<BaseTranslations<unknown>>
Defined in: packages/core/src/utils/QueryManager.ts:204
Translations, accepting the same shape as the translations prop. Only the placeholder
properties of fields, operators, and values are used, and only when the corresponding
autoSelect* option is false; the remaining keys describe UI elements that have no
meaning outside the QueryBuilder component. Labels are typed as unknown so the React
Translations type, whose labels are ReactNode, can be passed as-is.
validator?
optionalvalidator?:QueryValidator
Defined in: packages/core/src/utils/QueryManager.ts:311
Validates the query. Defaults to defaultValidator.
API documentation is generated from the latest commit on the main branch. It may be somewhat inconsistent with official releases of React Query Builder.