Type Alias GraffitiObjectStream<Schema>

GraffitiObjectStream: AsyncGenerator<
    GraffitiStreamError
    | GraffitiObjectStreamEntry<Schema>,
    GraffitiObjectStreamReturn<Schema>,
>

A stream of data that are returned by Graffiti's query-like operations Graffiti.discover and Graffiti.recoverOrphans.

Errors are returned within the stream rather than as exceptions that would halt the entire stream. This is because some implementations may pull data from multiple sources including some that may be unreliable. In many cases, these errors can be safely ignored. See GraffitiStreamError.

The stream is an AsyncGenerator that can be iterated over using for await loops or calling next on the generator. The stream can be terminated by breaking out of a loop calling return on the generator.

The stream ends by returning a continue function and a cursor string, each of which can be used to resume the stream from where it left off.

Type Parameters