@lamware/apollo
TypeScript icon, indicating that this package has built-in type declarations

2.0.1 • Public • Published
NPM Discord Apache-2.0

Lamware - Apollo Server

This Lamware Middleware utilizes the official apollo-server-lambda package to set-up your Apollo Server outside of the main handler, improving performance.

Installation

This package is available via NPM:

yarn add @lamware/apollo

# or

npm install @lamware/apollo

Usage

import type { APIGatewayProxyHandlerV2 } from 'aws-lambda';
import { ApolloServer } from 'apollo-server-lambda';
import { apollo } from '@lamware/apollo';
import { lamware } from '@lamware/core';

const { handler } = lamware<APIGatewayProxyHandlerV2<any>>()
  // You can pass regular Apollo options.
  .use(apollo({
    introspection: false,
    debug: false,
    schema: ...,
  }))
  // You can also pass an entire Apollo Server instance.
  .use(apollo(new ApolloServer({
    introspection: false,
    debug: false,
    schema: ...,
  })))
  // Or even an (a)synchronous closure!
  .use(apollo(async () => {
    return new ApolloServer({
      introspection: false,
      debug: false,
      schema: ...,
    });
  }))
  .execute(async (payload) => {
    return payload.state.apolloHandler(payload);
  });

export { handler };

Versions

Current Tags

VersionDownloads (Last 7 Days)Tag
2.0.10latest

Version History

VersionDownloads (Last 7 Days)Published
2.0.10
2.0.00
1.2.20
1.2.10
1.2.00
1.1.10
1.1.00
1.0.130
1.0.120
1.0.110
1.0.100
1.0.90
1.0.80
1.0.70
1.0.60
1.0.50
1.0.40
1.0.30
1.0.20
1.0.10

Package Sidebar

Install

npm i @lamware/apollo

Weekly Downloads

0

Version

2.0.1

License

GPL-3.0-only

Unpacked Size

1.69 MB

Total Files

43

Last publish

Collaborators

  • oyed