@vnodes/graphql
    Preparing search index...

    Interface GqlSubscriptionServiceOptions

    interface GqlSubscriptionServiceOptions {
        context?:
            | GraphQLExecutionContextValue
            | (
                (
                    ctx: Context<Record<string, unknown> | undefined, unknown>,
                    id: string,
                    payload: SubscribePayload,
                    args: ExecutionArgs,
                ) => GraphQLExecutionContextValue | Promise<GraphQLExecutionContextValue>
            );
        execute?: (
            args: ExecutionArgs,
        ) => PromiseOrValue<ExecutionResult<ObjMap<unknown>, ObjMap<unknown>>>;
        "graphql-ws"?: boolean | GraphQLWsSubscriptionsConfig;
        path?: string;
        schema: GraphQLSchema;
        subscribe?: (
            args: ExecutionArgs,
        ) => Promise<
            | ExecutionResult<ObjMap<unknown>, ObjMap<unknown>>
            | AsyncGenerator<
                ExecutionResult<ObjMap<unknown>, ObjMap<unknown>>,
                void,
                void,
            >,
        >;
        "subscriptions-transport-ws"?:
            | boolean
            | GraphQLSubscriptionTransportWsConfig;
    }

    Hierarchy (View Summary)

    Index

    Properties

    context?:
        | GraphQLExecutionContextValue
        | (
            (
                ctx: Context<Record<string, unknown> | undefined, unknown>,
                id: string,
                payload: SubscribePayload,
                args: ExecutionArgs,
            ) => GraphQLExecutionContextValue | Promise<GraphQLExecutionContextValue>
        )
    execute?: (
        args: ExecutionArgs,
    ) => PromiseOrValue<ExecutionResult<ObjMap<unknown>, ObjMap<unknown>>>

    Type Declaration

      • (
            args: ExecutionArgs,
        ): PromiseOrValue<ExecutionResult<ObjMap<unknown>, ObjMap<unknown>>>
      • Implements the "Executing requests" section of the GraphQL specification.

        Returns either a synchronous ExecutionResult (if all encountered resolvers are synchronous), or a Promise of an ExecutionResult that will eventually be resolved and never rejected.

        If the arguments to this function do not result in a legal execution context, a GraphQLError will be thrown immediately explaining the invalid input.

        Parameters

        • args: ExecutionArgs

        Returns PromiseOrValue<ExecutionResult<ObjMap<unknown>, ObjMap<unknown>>>

    "graphql-ws"?: boolean | GraphQLWsSubscriptionsConfig
    path?: string
    schema: GraphQLSchema
    subscribe?: (
        args: ExecutionArgs,
    ) => Promise<
        | ExecutionResult<ObjMap<unknown>, ObjMap<unknown>>
        | AsyncGenerator<
            ExecutionResult<ObjMap<unknown>, ObjMap<unknown>>,
            void,
            void,
        >,
    >

    Type Declaration

      • (
            args: ExecutionArgs,
        ): Promise<
            | ExecutionResult<ObjMap<unknown>, ObjMap<unknown>>
            | AsyncGenerator<
                ExecutionResult<ObjMap<unknown>, ObjMap<unknown>>,
                void,
                void,
            >,
        >
      • 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.

        Parameters

        • args: ExecutionArgs

        Returns Promise<
            | ExecutionResult<ObjMap<unknown>, ObjMap<unknown>>
            | AsyncGenerator<
                ExecutionResult<ObjMap<unknown>, ObjMap<unknown>>,
                void,
                void,
            >,
        >

    "subscriptions-transport-ws"?: boolean | GraphQLSubscriptionTransportWsConfig