JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 1
  • Score
    100M100P100Q18384F
  • License MIT

Apollo Server integration for HTTP, HTTPS and HTTP2

Package Exports

  • apollo-server-native

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (apollo-server-native) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

Apollo Server integration for HTTP, HTTPS and HTTP2

npm version

This integration of Apollo Server works with native HTTP, HTTPS and HTTP2.

Example with HTTP

Install apollo-server-native package with npm or yarn

const http = require('http')
const { ApolloServer, gql } = require('apollo-server-native')

const typeDefs = gql`
  type Query {
    "A simple type for getting started!"
    hello: String
  }
`

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

const server = new ApolloServer({ typeDefs, resolvers })
const serverHandler = server.createHandler()

const httpServer = http.createServer()

httpServer.on('request', serverHandler)

httpServer.listen(3000, () => console.log(`🚀 Server ready at http://localhost:3000`))