aws-lambda-ws-link
TypeScript icon, indicating that this package has built-in type declarations

0.13.0 • Public • Published

Apollo WebSocket link for AWS Lambda subscriptions

Apollo WebSocket link supporting AWS Lambda subscriptions (utilizing AWS API Gateway v2) for aws-lambda-graphql package.

Installation

yarn add aws-lambda-ws-link graphql
# or
npm install aws-lambda-ws-link graphql

Usage

Implement your simple client

import { Client, WebSocketLink } from 'aws-lambda-ws-link';
import { InMemoryCache } from 'apollo-cache-inmemory';
import { ApolloClient } from 'apollo-client';
 
const wsClient = new Client({
  uri: 'ws://localhost:8000',
});
const link = new WebSocketLink(client);
const client = new ApolloClient({
  cache: new InMemoryCache(),
  link,
});
 
// ...

Examples

  • Chat App - React app
  • Chat Server
    • contains AWS Lambda that handles HTTP, WebSocket and DynamoDB streams
    • also includes serverless.yaml file for easy deployment

Package Sidebar

Install

npm i aws-lambda-ws-link

Weekly Downloads

2

Version

0.13.0

License

none

Unpacked Size

5.72 kB

Total Files

11

Last publish

Collaborators

  • michalkvasnicak