Socket
Socket
Sign inDemoInstall

apollo-server-integrations-cloudflare-workers

Package Overview
Dependencies
162
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

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


Version published
Weekly downloads
17
decreased by-55.26%
Maintainers
1
Created
Weekly downloads
 

Readme

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

FAQs

Last updated on 16 Dec 2022

Did you know?

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc