Prometheus Entity Management API
    Preparing search index...

    Write handle passed to a batchGraphWrites callback. Every method returns the handle for chaining.

    interface GraphBatch {
        clearPatch(type: string, id: string): GraphBatch;
        insertIdInList(
            key: string,
            id: string,
            position: number | "end" | "start",
        ): GraphBatch;
        patchEntity(
            type: string,
            id: string,
            patch: Record<string, unknown>,
        ): GraphBatch;
        readEntity<T = Record<string, unknown>>(type: string, id: string): T | null;
        removeEntity(type: string, id: string): GraphBatch;
        removeIdFromAllLists(type: string, id: string): GraphBatch;
        replaceEntity(
            type: string,
            id: string,
            data: Record<string, unknown>,
        ): GraphBatch;
        setEntitySyncMetadata(
            type: string,
            id: string,
            metadata: Partial<EntitySyncMetadata>,
        ): GraphBatch;
        setListIds(
            key: string,
            ids: readonly string[],
            entityType?: string,
        ): GraphBatch;
        unpatchEntity(
            type: string,
            id: string,
            keys: readonly string[],
        ): GraphBatch;
        upsertEntities(
            type: string,
            entries: readonly { data: Record<string, unknown>; id: string }[],
        ): GraphBatch;
        upsertEntity(
            type: string,
            id: string,
            data: Record<string, unknown>,
        ): GraphBatch;
    }
    Index
    • Parameters

      • type: string
      • id: string

      Returns GraphBatch

    • Parameters

      • key: string
      • id: string
      • position: number | "end" | "start"

      Returns GraphBatch

    • Parameters

      • type: string
      • id: string
      • patch: Record<string, unknown>

      Returns GraphBatch

    • Read canonical data merged with patches, including writes made earlier in this batch.

      Type Parameters

      • T = Record<string, unknown>

      Parameters

      • type: string
      • id: string

      Returns T | null

    • Remove the canonical entity, its patches, fetch state and sync metadata (not its list memberships).

      Parameters

      • type: string
      • id: string

      Returns GraphBatch

    • Parameters

      • type: string
      • id: string

      Returns GraphBatch

    • Parameters

      • type: string
      • id: string
      • data: Record<string, unknown>

      Returns GraphBatch

    • Set a list's ordered ids (deduplicated) without changing its fetch or pagination metadata.

      Parameters

      • key: string
      • ids: readonly string[]
      • OptionalentityType: string

      Returns GraphBatch

    • Parameters

      • type: string
      • id: string
      • keys: readonly string[]

      Returns GraphBatch

    • Parameters

      • type: string
      • entries: readonly { data: Record<string, unknown>; id: string }[]

      Returns GraphBatch

    • Parameters

      • type: string
      • id: string
      • data: Record<string, unknown>

      Returns GraphBatch