Skip to main content
Latest
function createSourceEventStream
import { createSourceEventStream } from "https://deno.land/x/graphql_deno@v15.0.0/mod.ts";

Implements the "CreateSourceEventStream" algorithm described in the GraphQL specification, resolving the subscription source event stream.

Returns a Promise.

If the client-provided invalid arguments, the source stream could not be created, or the resolver did not return an AsyncIterable, this function will will throw an error, which should be caught and handled by the caller.

A Source Event Stream represents a sequence of events, each of which triggers a GraphQL execution for that event.

This may be useful when hosting the stateful subscription service in a different process or machine than the stateless GraphQL execution engine, or otherwise separating these two steps. For more on this, see the "Supporting Subscriptions at Scale" information in the GraphQL specification.

Parameters

document: DocumentNode
optional
rootValue: any
optional
contextValue: any
optional
variableValues: { [key: string]: any; }
optional
operationName: Maybe<string>
optional
fieldResolver: Maybe<GraphQLFieldResolver<any, any>>

Returns

Promise<AsyncIterable<any> | ExecutionResult>