Options interface defines configuration parameters for the meros() function.
Type definition
Properties
Controls how parts are yielded from the async generator.When
false (default), the generator yields each part individually as soon as it’s parsed.When true, the generator collects all complete parts from each chunk and yields them as an array.This is an optimization for scenarios where you want to batch-process multiple parts synchronously, such as committing multiple GraphQL payloads to a store at once.Usage
Default behavior (multiple: false)
Multiple mode (multiple: true)
GraphQL use case
Themultiple option is particularly useful for GraphQL subscriptions with @defer and @stream directives:
Type impact
Themultiple option affects the return type:
Performance considerations
- Default mode (
multiple: false): Lower latency - parts are processed immediately as they arrive - Multiple mode (
multiple: true): Better throughput - reduces the number of async iterations and enables batch processing