Skip to main content

resolveCandidateQuery()

resolveCandidateQuery<RG extends RuleGroupTypeAny>(sources: { defaultQuery?: RG; fallbackQuery: RG; query?: RG; storeQuery?: RG; }, options?: { idGenerator?: () => string; }): RG

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

Resolves the query a query builder should render from the available sources, in precedence order: the controlled query, then whatever is already in the store, then the uncontrolled defaultQuery, then a freshly created empty group.

The result is prepared with prepareRuleGroup unless it already has an id, which is taken to mean it has been prepared before—most often because the caller is passing back the object it received from onQueryChange.

Type Parameters​

Type Parameter
RG extends RuleGroupTypeAny

Parameters​

ParameterType
sources{ defaultQuery?: RG; fallbackQuery: RG; query?: RG; storeQuery?: RG; }
sources.defaultQuery?RG
sources.fallbackQuery?RG
sources.query?RG
sources.storeQuery?RG
options?{ idGenerator?: () => string; }
options.idGenerator?() => string

Returns​

RG


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.