MutationSource.mutation
property · packages/remote-server/src/index.ts:789
readonly mutation: stringRemote / foldkit-remote-server
interface · packages/remote-server/src/index.ts:788
interface MutationSource<P, R = never> {
readonly mutation: string
readonly writes?: {
readonly entity: string
readonly writer: unknown
readonly write: AnyWrite
}
readonly Input: Schema.Codec<unknown>
readonly Output: Schema.Codec<unknown>
readonly Refusal: Schema.Codec<unknown, unknown>
readonly run: (context: {
readonly input: unknown
readonly principal: P
readonly viewer: Option.Option<EntityRef>
readonly requestId: string
readonly operation: Option.Option<string>
readonly now: number
readonly read: (
ref: EntityRef,
fields: ReadonlyArray<string>,
) => Effect.Effect<
Option.Option<Readonly<Record<string, unknown>>>,
RemoteServerError
>
readonly keys?: ReadonlyArray<string> | undefined
}) => Effect.Effect<
{
readonly output: unknown
readonly entities: ReadonlyArray<NormalizedPatch>
readonly connections: ReadonlyArray<ConnectionChange>
readonly deleted: ReadonlyArray<{
readonly entity: string
readonly id: string
}>
readonly pointed?: ReadonlyArray<{
readonly entity: string
readonly id: string
}>
},
| RemoteServerError
| MutationRefused
| RemoteForbidden
| RemoteUnauthenticated,
R
>
}MutationSource.mutationproperty · packages/remote-server/src/index.ts:789
readonly mutation: stringMutationSource.writesproperty · packages/remote-server/src/index.ts:795
readonly writes?: {
readonly entity: string
readonly writer: unknown
readonly write: AnyWrite
}For a declared write (RemoteServer.write), the Entity it writes, the
writer it lands through, as it was given one, and the write itself. The
server never reads it; a startup check such as GuardServer.validate does.
MutationSource.Inputproperty · packages/remote-server/src/index.ts:796
readonly Input: Schema.Codec<unknown>MutationSource.Outputproperty · packages/remote-server/src/index.ts:797
readonly Output: Schema.Codec<unknown>MutationSource.Refusalproperty · packages/remote-server/src/index.ts:798
readonly Refusal: Schema.Codec<unknown, unknown>MutationSource.runproperty · packages/remote-server/src/index.ts:799
readonly run: (context: {
readonly input: unknown
readonly principal: P
readonly viewer: Option.Option<EntityRef>
readonly requestId: string
readonly operation: Option.Option<string>
readonly now: number
readonly read: (
ref: EntityRef,
fields: ReadonlyArray<string>,
) => Effect.Effect<
Option.Option<Readonly<Record<string, unknown>>>,
RemoteServerError
>
readonly keys?: ReadonlyArray<string> | undefined
}) => Effect.Effect<
{
readonly output: unknown
readonly entities: ReadonlyArray<NormalizedPatch>
readonly connections: ReadonlyArray<ConnectionChange>
readonly deleted: ReadonlyArray<{
readonly entity: string
readonly id: string
}>
readonly pointed?: ReadonlyArray<{
readonly entity: string
readonly id: string
}>
},
| RemoteServerError
| MutationRefused
| RemoteForbidden
| RemoteUnauthenticated,
R
>