call method

Future<Output> call(
  1. Input? input, {
  2. StreamingCallback<Chunk>? onChunk,
  3. Map<String, dynamic>? context,
  4. Stream<Input>? inputStream,
  5. Init? init,
  6. TraceStartCallback? onTraceStart,
  7. CancellationToken? cancel,
})

Implementation

Future<Output> call(
  Input? input, {
  StreamingCallback<Chunk>? onChunk,
  Map<String, dynamic>? context,
  Stream<Input>? inputStream,
  Init? init,
  TraceStartCallback? onTraceStart,
  CancellationToken? cancel,
}) async {
  return (await run(
    input,
    onChunk: onChunk,
    context: context,
    inputStream: inputStream,
    // Validate `init` against the schema, matching `runRaw`. The static type
    // only guarantees shape; value-level constraints (enum membership,
    // numeric ranges, required nested fields) still need the schema. Skip
    // when either the schema or the value is absent, mirroring `runRaw`.
    init: (initSchema != null && init != null)
        ? initSchema!.parse(init)
        : init,
    onTraceStart: onTraceStart,
    cancel: cancel,
  )).result;
}