Skip to content

readGraphExportStream

readGraphExportStream(source, session, expected, options?): AsyncGenerator<{ wref: string; durableId: string; version: number; active: true; data: Record<string, unknown>; kind: "thing"; shapes: string[]; collections?: object[]; about?: { wref: string; v?: number; durableId: string; }; affirmed?: object[]; } | { wref: string; durableId: string; version: number; active: true; data: Record<string, unknown>; kind: "shape"; shapes: string[]; retracted?: true; } | { wref: string; durableId: string; version: number; kind: "thing" | "shape"; active: false; }>

Read one HTTP response body as export records, verifying it against the session as it goes: header continuity, per-line canonical decode, the rolling digest, and finally the trailer.

expected also accepts the deprecated repo / sinceRepoSeq / atRepoSeq keys until 2026-12-15.

ReadableStream<Uint8Array<unknown>> | AsyncIterable<Uint8Array<unknown>, any, any>

GraphExportSession

unknown

GraphExportSegmentOptions = {}

AsyncGenerator<{ wref: string; durableId: string; version: number; active: true; data: Record<string, unknown>; kind: "thing"; shapes: string[]; collections?: object[]; about?: { wref: string; v?: number; durableId: string; }; affirmed?: object[]; } | { wref: string; durableId: string; version: number; active: true; data: Record<string, unknown>; kind: "shape"; shapes: string[]; retracted?: true; } | { wref: string; durableId: string; version: number; kind: "thing" | "shape"; active: false; }>