Remote / foldkit-remote-server

QuerySource

interface · packages/remote-server/src/index.ts:864

interface QuerySource<P, R = never> {
  readonly query: string
  readonly entity: string
  readonly Input: Schema.Codec<unknown>
  readonly run: (context: {
    readonly input: unknown
    readonly window: QueryWindow
    readonly principal: P
    readonly viewer?: Option.Option<EntityRef> | undefined
    readonly select?: RelationRequirement | undefined
  }) => Effect.Effect<QueryPage, RemoteServerError, R>
  readonly visible?: unknown
  readonly cache?: CachePolicy | undefined
}

In the guides

Members

QuerySource.query

property · packages/remote-server/src/index.ts:865

readonly query: string

QuerySource.entity

property · packages/remote-server/src/index.ts:867

readonly entity: string

The entity whose rows it lists: a list read live selects rows of no other.

QuerySource.Input

property · packages/remote-server/src/index.ts:868

readonly Input: Schema.Codec<unknown>

QuerySource.run

property · packages/remote-server/src/index.ts:869

readonly run: (context: {
  readonly input: unknown
  readonly window: QueryWindow
  readonly principal: P
  readonly viewer?: Option.Option<EntityRef> | undefined
  readonly select?: RelationRequirement | undefined
}) => Effect.Effect<QueryPage, RemoteServerError, R>

QuerySource.visible

property · packages/remote-server/src/index.ts:884

readonly visible?: unknown

The rule that decides which rows the query lists. See EntitySource.visible.

QuerySource.cache

property · packages/remote-server/src/index.ts:886

readonly cache?: CachePolicy | undefined

How long an answer stays fresh, from the Query's declaration. See EntitySource.cache.