Hi there! Are you looking for the official Deno documentation? Try docs.deno.com for all your Deno learning needs.

subscribe

Implements the "Subscribe" algorithm described in the GraphQL specification.

Returns a Promise which resolves to either an AsyncIterator (if successful) or an ExecutionResult (error). The promise will be rejected if the schema or other arguments to this function are invalid, or if the resolved event stream is not an async iterable.

If the client-provided arguments to this function do not result in a compliant subscription, a GraphQL Response (ExecutionResult) with descriptive errors and no data will be returned.

If the source stream could not be created due to faulty subscription resolver logic or underlying systems, the promise will resolve to a single ExecutionResult containing errors and no data.

If the operation succeeded, the promise resolves to an AsyncIterator, which yields a stream of ExecutionResults representing the response stream.

Accepts either an object with named arguments, or individual arguments.

function subscribe(args: ExecutionArgs): Promise<AsyncGenerator<ExecutionResult, void, void> | ExecutionResult>;
§
subscribe(args: ExecutionArgs): Promise<AsyncGenerator<ExecutionResult, void, void> | ExecutionResult>
[src]

§Parameters

§Return Type

§
Promise<AsyncGenerator<ExecutionResult, void, void> | ExecutionResult>
[src]