Skip to main content

GuardOptions

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

Options that block a mutation before it is attempted.

disabled is a property of the query itself, so honoring it is a matter of data integrity rather than presentation: a query saved with a locked rule should stay locked when it is loaded again. It is opt-in here only to preserve the existing behavior of the standalone query tools; QueryManager enables it by default.

Extended by

Properties

disabledPaths?

optional disabledPaths?: Path[]

Defined in: packages/core/src/utils/queryTools.ts:108

Paths that are disabled without the corresponding rule or group carrying a disabled property, mirroring the array form of the QueryBuilder disabled prop. A path is treated as disabled if it appears here or descends from a path that does.

Like the disabled property, this is only honored when respectDisabled is true, and updating a rule or group's own disabled property is still permitted.


maxLevels?

optional maxLevels?: number

Defined in: packages/core/src/utils/queryTools.ts:115

The maximum depth at which a group may be added. A group whose parent path is already this deep is rejected by add and insert. Rules are unaffected. Defaults to Infinity.


queryDisabled?

optional queryDisabled?: boolean

Defined in: packages/core/src/utils/queryTools.ts:110

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


respectDisabled?

optional respectDisabled?: boolean

Defined in: packages/core/src/utils/queryTools.ts:99

Abort when the target (or its parent, for add/insert) is disabled, either directly or by descending from a disabled group. Defaults to false.

Updating a rule or group's own disabled property is always permitted, since it is the only way to re-enable it.


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.