QueryExplanation.domain
property · packages/remote/src/why.ts:63
readonly domain: stringThe bound Remote domain that answers it.
Remote / foldkit-remote/why
interface · packages/remote/src/why.ts:61
interface QueryExplanation {
readonly domain: string
readonly query: string
readonly input: unknown
readonly identity: string
readonly window: QueryWindow
readonly select: RelationRequirement
readonly body?: string | undefined
readonly dependencies?: ExplainedDependencies | undefined
readonly state: RemoteData<unknown>['_tag']
readonly surfaces?: ReadonlyArray<string> | undefined
readonly activation?:
| ReadonlyArray<{
readonly surface: string
readonly path: readonly string[]
readonly tag: string
}>
| undefined
}What one query read is, and what it currently is — data-query-DESIGN §29.1.
Every member is gathered from something that already existed: the read was always this many pieces, and nothing had ever been asked to put them in one place. It is plain serializable data, so a DevTools panel, a log line and a test assert on the same value.
Two members of §29.1's sketch are not here, and their absence is the finding rather than an omission:
explain cannot
recover it alone. Given the active Surfaces (the same record
subscriptions takes), it reports every Surface reading the connection
rather than guessing one, and omits the member entirely when it was not
given them.RemoteClient Layer in
the runtime, not a value in the Model, and a pure read of the Model cannot
see it. That is the same boundary that makes this function pure and
replayable, so it is worth more than the line of text.And one that the design proposed and this does not want: expectation
(required versus optional). §11 left it unbuilt for want of a consumer, and
the explanation was the likeliest consumer. It turns out not to need it — a
query's result is a connection, so the shape is a Page, decided by the
definition rather than by the read. Nothing here has an opinion about whether
an empty one is an error, because nothing here has to have one.
QueryExplanation.domainproperty · packages/remote/src/why.ts:63
readonly domain: stringThe bound Remote domain that answers it.
QueryExplanation.queryproperty · packages/remote/src/why.ts:65
readonly query: stringThe definition's name.
QueryExplanation.inputproperty · packages/remote/src/why.ts:67
readonly input: unknownThe input as encoded, which is what the identity is built from.
QueryExplanation.identityproperty · packages/remote/src/why.ts:69
readonly identity: stringThe connection identity: definition plus canonical input, excluding the window.
QueryExplanation.windowproperty · packages/remote/src/why.ts:71
readonly window: QueryWindowHow much of the connection this read asks for.
QueryExplanation.selectproperty · packages/remote/src/why.ts:73
readonly select: RelationRequirementWhat it reads of each item, as the slice asked of the server.
QueryExplanation.bodyproperty · packages/remote/src/why.ts:79
readonly body?: string | undefinedWhat the query means, as readable text — Query.show, and so neither SQL
nor whatever the backend compiled. Absent for a definition made with
Query.make, whose meaning lives on the server that answers it.
QueryExplanation.dependenciesproperty · packages/remote/src/why.ts:85
readonly dependencies?: ExplainedDependencies | undefinedThe fields, inputs and operations the body reads; absent with the body. Plain data, so it serializes: a field is its Entity's name and key, which is unambiguous because a query reads one Entity.
QueryExplanation.stateproperty · packages/remote/src/why.ts:87
readonly state: RemoteData<unknown>['_tag']What the read answers from this Model right now.
QueryExplanation.surfacesproperty · packages/remote/src/why.ts:93
readonly surfaces?: ReadonlyArray<string> | undefinedThe active Surfaces reading this connection at this Model, if the active record was supplied. Plural because several may, which is why a Projection cannot carry the answer itself.
QueryExplanation.activationproperty · packages/remote/src/why.ts:99
readonly activation?:
| ReadonlyArray<{
readonly surface: string
readonly path: readonly string[]
readonly tag: string
}>
| undefinedWhy each of those Surfaces is active, where it was placed with
Surface.when — the Model path and the tag, without running anything. A
Surface placed with Surface.at has no entry: a callback cannot be read.