Socket
Book a DemoInstallSign in
Socket

apollo-server-integrations-cloudflare-workers

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

apollo-server-integrations-cloudflare-workers

[![NPM version](https://badge.fury.io/js/apollo-server-integrations-cloudflare-workers.svg)](https://www.npmjs.com/package/apollo-server-integrations-cloudflare-workers) [![NPM downloads](https://img.shields.io/npm/dm/apollo-server-integrations-cloudflare

0.1.5
latest
Source
npmnpm
Version published
Weekly downloads
1.2K
47.95%
Maintainers
1
Weekly downloads
 
Created
Source

NPM version NPM downloads

Apollo Server Integration for Cloudflare Workers

Installation

npm install apollo-server-integrations-cloudflare-workers

Usage

import { ApolloServer } from '@apollo/server'
import { startServerAndCreateCloudflareWorkersHandler } from 'apollo-server-integrations-cloudflare-workers'

interface Context {
  // ....
}

interface Environment {
  // ...
}

const resolvers = {
  Query: {
    hello: () => 'world',
  },
}

const typeDefs = `
  type Query {
    hello: String
  }
`

const apolloServer = new ApolloServer<Context>({
  resolvers,
  typeDefs,
})

export default {
  fetch: startServerAndCreateCloudflareWorkersHandler<Environment, Context>(
    apolloServer,
    {
      async context() {
        return {
          // ...
        }
      },
      path: '/graphql',
    },
  ),
}

Example projects

Apollo Server v4

https://github.com/dnalborczyk/apollo-server-cloudflare-workers

Apollo Federation v2 with Apollo Server v4, Apollo Gateway v2, Apollo Subgraph v2

https://github.com/dnalborczyk/apollo-federation-cloudflare-workers

Keywords

apollo

FAQs

Package last updated on 16 Dec 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

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.