Skip to main content

QueryActionsConfig

Defined in: packages/core/src/utils/queryActions.ts:53

Configuration for createQueryActions.

Extends​

Properties​

combinators?​

optional combinators?: OptionList

Defined in: packages/core/src/utils/queryActions.ts:56


disabledPaths?​

optional disabledPaths?: Path[]

Defined in: packages/core/src/utils/queryActions.ts:72

Paths disabled by position rather than by a disabled property on the node itself, mirroring the array form of the QueryBuilder disabled prop. Honored only when respectDisabled is true; as with the disabled property, a node's own disabled can always be changed.


freeze?​

optional freeze?: boolean

Defined in: packages/core/src/utils/queryActions.ts:89

Set false to skip immer's auto-freeze on the queries these handlers return, matching the option of the same name on the query tools and QueryManager.

Deep-freezing throws on the reactive proxies used by signals-based frameworks (Svelte $state, Vue reactive), so an adapter whose storage may hand a proxied query to these handlers has to turn it off.

Default​

true

getMatchModes?​

optional getMatchModes?: (field: string) => MatchModeOptions

Defined in: packages/core/src/utils/queryActions.ts:78

Parameters​

ParameterType
fieldstring

Returns​

MatchModeOptions


getRuleDefaultOperator?​

optional getRuleDefaultOperator?: (field: string) => string

Defined in: packages/core/src/utils/queryActions.ts:75

Parameters​

ParameterType
fieldstring

Returns​

string


getRuleDefaultValue?​

optional getRuleDefaultValue?: (rule: RuleType) => any

Defined in: packages/core/src/utils/queryActions.ts:77

Parameters​

ParameterType
ruleRuleType

Returns​

any


getValueSources?​

optional getValueSources?: (field: string, operator: string) => [{ label: string; name: ValueSource; value: ValueSource; }, ...{ label: string; name: ValueSource; value: ValueSource }[]]

Defined in: packages/core/src/utils/queryActions.ts:76

Parameters​

ParameterType
fieldstring
operatorstring

Returns​

[{ label: string; name: ValueSource; value: ValueSource; }, ...{ label: string; name: ValueSource; value: ValueSource }[]]


idGenerator?​

optional idGenerator?: () => string

Defined in: packages/core/src/utils/queryActions.ts:57

Returns​

string


maxLevels?​

optional maxLevels?: number

Defined in: packages/core/src/utils/queryActions.ts:59

The maximum depth at which groups may be added. Defaults to Infinity.


onAddGroup?​

optional onAddGroup?: (ruleGroup: any, parentPath: Path, query: any, context?: any) => boolean | RuleGroupTypeAny

Defined in: packages/core/src/utils/queryActions.ts:34

Parameters​

ParameterType
ruleGroupany
parentPathPath
queryany
context?any

Returns​

boolean | RuleGroupTypeAny

Inherited from​

QueryActionCallbacks.onAddGroup


onAddRule?​

optional onAddRule?: (rule: RuleType, parentPath: Path, query: any, context?: any) => boolean | RuleType<string, string, any, string, Record<string, any>>

Defined in: packages/core/src/utils/queryActions.ts:33

Parameters​

ParameterType
ruleRuleType
parentPathPath
queryany
context?any

Returns​

boolean | RuleType<string, string, any, string, Record<string, any>>

Inherited from​

QueryActionCallbacks.onAddRule


onGroupGroup?​

optional onGroupGroup?: (...args: any[]) => boolean | RuleGroupTypeAny

Defined in: packages/core/src/utils/queryActions.ts:44

Parameters​

ParameterType
...argsany[]

Returns​

boolean | RuleGroupTypeAny

Inherited from​

QueryActionCallbacks.onGroupGroup


onGroupRule?​

optional onGroupRule?: (...args: any[]) => boolean | RuleGroupTypeAny

Defined in: packages/core/src/utils/queryActions.ts:43

Parameters​

ParameterType
...argsany[]

Returns​

boolean | RuleGroupTypeAny

Inherited from​

QueryActionCallbacks.onGroupRule


onLog?​

optional onLog?: (payload: Record<string, any>) => void

Defined in: packages/core/src/utils/queryActions.ts:91

Receives a structured event for every action, applied or aborted.

Parameters​

ParameterType
payloadRecord<string, any>

Returns​

void


onMoveGroup?​

optional onMoveGroup?: (...args: any[]) => boolean | RuleGroupTypeAny

Defined in: packages/core/src/utils/queryActions.ts:42

Parameters​

ParameterType
...argsany[]

Returns​

boolean | RuleGroupTypeAny

Inherited from​

QueryActionCallbacks.onMoveGroup


onMoveRule?​

optional onMoveRule?: (...args: any[]) => boolean | RuleGroupTypeAny

Defined in: packages/core/src/utils/queryActions.ts:41

Parameters​

ParameterType
...argsany[]

Returns​

boolean | RuleGroupTypeAny

Inherited from​

QueryActionCallbacks.onMoveRule


onRemove?​

optional onRemove?: (ruleOrGroup: any, path: Path, query: any, context?: any) => boolean

Defined in: packages/core/src/utils/queryActions.ts:40

Parameters​

ParameterType
ruleOrGroupany
pathPath
queryany
context?any

Returns​

boolean

Inherited from​

QueryActionCallbacks.onRemove


onUngroup?​

optional onUngroup?: (...args: any[]) => boolean | RuleGroupTypeAny

Defined in: packages/core/src/utils/queryActions.ts:45

Parameters​

ParameterType
...argsany[]

Returns​

boolean | RuleGroupTypeAny

Inherited from​

QueryActionCallbacks.onUngroup


qbId?​

optional qbId?: string

Defined in: packages/core/src/utils/queryActions.ts:55

Identifier included in every log payload.


queryDisabled?​

optional queryDisabled?: boolean

Defined in: packages/core/src/utils/queryActions.ts:61

Abort every mutation, as though the entire query were disabled.


resetOnFieldChange?​

optional resetOnFieldChange?: boolean

Defined in: packages/core/src/utils/queryActions.ts:73


resetOnOperatorChange?​

optional resetOnOperatorChange?: boolean

Defined in: packages/core/src/utils/queryActions.ts:74


respectDisabled?​

optional respectDisabled?: boolean

Defined in: packages/core/src/utils/queryActions.ts:66

Honor disabled properties within the query. Defaults to true, matching the QueryBuilder component; a node's own disabled property can always be changed.


caution

API documentation is generated from the latest commit on the main branch. It may be somewhat inconsistent with official releases of React Query Builder.