Skip to content

routier-collection


routier-collection / core/src / deserializeQueryOptions

Function: deserializeQueryOptions()

deserializeQueryOptions(serialized, schema, resolveSchema, scopeFor?): QueryOptionsCollection<any>

Defined in: core/src/plugins/wire/query.ts:187

Rebuilds query options from their wire form, against the receiver's own schemas.

The closures that were dropped are reconstructed here rather than sent:

  • a sort selector from its property, which is all JsonTranslator.sort reads;
  • a filter predicate from its expression tree, via toStrictPredicate — which THROWS rather than keeping a row it cannot judge, because on a receiver a filter that quietly stops filtering returns rows the requester excluded.

Parameters

serialized

SerializedQueryOption[]

schema

CompiledSchema<any>

resolveSchema

SchemaResolver

scopeFor?

ScopeProvider

A receiver-side filter per collection, applied to this collection AND to every collection a join reaches. Prepended, so it is ANDed with whatever the sender sent and there is no order of options that removes it.

Returns

QueryOptionsCollection<any>

Throws

when a named property or collection is not declared by the receiver's schemas. A payload describing data this side does not have is a disagreement, and it has to be loud.

Released under the MIT License.