Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@graphile-contrib/graphql-sse

Package Overview
Dependencies
Maintainers
4
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@graphile-contrib/graphql-sse

PostGraphile support for GraphQL over Server-Sent Events (SSE) powered by graphql-sse

  • 1.0.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
4
Created
Source

@graphile-contrib/graphql-sse

PostGraphile support for GraphQL over Server-Sent Events (SSE) powered by graphql-sse.

  • Doesn't mess with the schema update stream on eventSourceRoute, both can exist on the same route
  • PUT and DELETE methods are allowed through CORS on the eventSourceRoute in order to support the "single connection mode"
  • The client can use the X-GraphQL-Event-Stream header for SSE endpoint discovery

Getting started

Install

npm install --save graphql-sse @graphile-contrib/graphql-sse

or

yarn add graphql-sse @graphile-contrib/graphql-sse

Integrate the plugin

PostGraphile CLI
postgraphile \
  --plugins @graphile/graphql-sse \
  ...
PostGraphile library
import { postgraphile, makePluginHook } from 'postgraphile';
import GraphQLSSEPlugin from '@graphile-contrib/graphql-sse';

const postGraphileMiddleware = postgraphile(databaseUrl, 'app_public', {
  pluginHook: makePluginHook([GraphQLSSEPlugin]),
  eventStreamRoute: '/graphql/stream', // default
});

Use the client

Connect to the specified PostGraphileOptions.eventStreamRoute.

For further usage inspiration, please consult the graphql-sse readme.

Keywords

FAQs

Package last updated on 15 Apr 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc