graphql-subscriptions

  • Version 2.0.0
  • Published
  • 53.1 kB
  • 1 dependency
  • MIT license

Install

npm i graphql-subscriptions
yarn add graphql-subscriptions
pnpm add graphql-subscriptions

Overview

GraphQL subscriptions for node.js

Index

Functions

function withFilter

withFilter: (asyncIteratorFn: ResolverFn, filterFn: FilterFn) => ResolverFn;

    Classes

    class PubSub

    class PubSub extends PubSubEngine {}

      constructor

      constructor(options?: PubSubOptions);

        property ee

        protected ee: EventEmitter;

          method publish

          publish: (triggerName: string, payload: any) => Promise<void>;

            method subscribe

            subscribe: (
            triggerName: string,
            onMessage: (...args: any[]) => void
            ) => Promise<number>;

              method unsubscribe

              unsubscribe: (subId: number) => void;

                class PubSubEngine

                abstract class PubSubEngine {}

                  method asyncIterator

                  asyncIterator: <T>(triggers: string | string[]) => AsyncIterator<T>;

                    method publish

                    abstract publish: (triggerName: string, payload: any) => Promise<void>;

                      method subscribe

                      abstract subscribe: (
                      triggerName: string,
                      onMessage: Function,
                      options: Object
                      ) => Promise<number>;

                        method unsubscribe

                        abstract unsubscribe: (subId: number) => any;

                          Interfaces

                          interface PubSubOptions

                          interface PubSubOptions {}

                            property eventEmitter

                            eventEmitter?: EventEmitter;

                              Type Aliases

                              type FilterFn

                              type FilterFn = (
                              rootValue?: any,
                              args?: any,
                              context?: any,
                              info?: any
                              ) => boolean | Promise<boolean>;

                                type ResolverFn

                                type ResolverFn = (
                                rootValue?: any,
                                args?: any,
                                context?: any,
                                info?: any
                                ) => AsyncIterator<any>;

                                  Package Files (4)

                                  Dependencies (1)

                                  Dev Dependencies (17)

                                  Peer Dependencies (1)

                                  Badge

                                  To add a badge like this onejsDocs.io badgeto your package's README, use the codes available below.

                                  You may also use Shields.io to create a custom badge linking to https://www.jsdocs.io/package/graphql-subscriptions.

                                  • Markdown
                                    [![jsDocs.io](https://img.shields.io/badge/jsDocs.io-reference-blue)](https://www.jsdocs.io/package/graphql-subscriptions)
                                  • HTML
                                    <a href="https://www.jsdocs.io/package/graphql-subscriptions"><img src="https://img.shields.io/badge/jsDocs.io-reference-blue" alt="jsDocs.io"></a>