{"name":"apollo-server-koa","version":"2.26.2","description":"Production-ready Node.js GraphQL server for Koa","main":"dist/index.js","types":"dist/index.d.ts","repository":{"type":"git","url":"git+https://github.com/apollographql/apollo-server.git","directory":"packages/apollo-server-koa"},"keywords":["GraphQL","Apollo","Server","Koa","Javascript"],"author":{"name":"Apollo","email":"opensource@apollographql.com"},"license":"MIT","bugs":{"url":"https://github.com/apollographql/apollo-server/issues"},"homepage":"https://github.com/apollographql/apollo-server#readme","engines":{"node":">=6"},"dependencies":{"@apollographql/graphql-playground-html":"1.6.27","@koa/cors":"^2.2.1","@types/accepts":"^1.3.5","@types/koa":"^2.0.46","@types/koa-bodyparser":"^4.2.1","@types/koa-compose":"^3.2.2","@types/koa__cors":"^2.2.1","accepts":"^1.3.5","apollo-server-core":"^2.26.2","apollo-server-types":"^0.10.0","graphql-subscriptions":"^1.0.0","graphql-tools":"^4.0.8","koa":"2.13.1","koa-bodyparser":"^4.2.1","koa-compose":"^4.1.0","type-is":"^1.6.16"},"devDependencies":{"apollo-server-integration-testsuite":"^2.26.2"},"peerDependencies":{"graphql":"^0.12.0 || ^0.13.0 || ^14.0.0 || ^15.0.0"},"gitHead":"8fbc66cded6549d5a61433c9fed26775e60e0648","readme":"[![npm version](https://badge.fury.io/js/apollo-server-koa.svg)](https://badge.fury.io/js/apollo-server-koa)\n[![Build Status](https://circleci.com/gh/apollographql/apollo-server/tree/main.svg?style=svg)](https://circleci.com/gh/apollographql/apollo-server)\n[![Join the community forum](https://img.shields.io/badge/join%20the%20community-forum-blueviolet)](https://community.apollographql.com)\n[![Read CHANGELOG](https://img.shields.io/badge/read-changelog-blue)](https://github.com/apollographql/apollo-server/blob/HEAD/CHANGELOG.md)\n\n\nThis is the Koa integration of GraphQL Server. Apollo Server is a community-maintained open-source GraphQL server that works with many Node.js HTTP server frameworks. [Read the docs](https://www.apollographql.com/docs/apollo-server/). [Read the CHANGELOG.](https://github.com/apollographql/apollo-server/blob/main/CHANGELOG.md)\n\n```shell\nnpm install apollo-server-koa graphql\n```\n\n## Koa\n\n```js\nconst Koa = require('koa');\nconst { ApolloServer, gql } = require('apollo-server-koa');\n\nasync function startApolloServer() {\n  // Construct a schema, using GraphQL schema language\n  const typeDefs = gql`\n    type Query {\n      hello: String\n    }\n  `;\n\n  // Provide resolver functions for your schema fields\n  const resolvers = {\n    Query: {\n      hello: () => 'Hello world!',\n    },\n  };\n\n  const server = new ApolloServer({ typeDefs, resolvers });\n  await server.start();\n\n  const app = new Koa();\n  server.applyMiddleware({ app });\n  // alternatively you can get a composed middleware from the apollo server\n  // app.use(server.getMiddleware());\n\n  await new Promise(resolve => app.listen({ port: 4000 }, resolve));\n  console.log(`🚀 Server ready at http://localhost:4000${server.graphqlPath}`);\n  return { server, app };\n}\n```\n\n## Principles\n\nGraphQL Server is built with the following principles in mind:\n\n- **By the community, for the community**: GraphQL Server's development is driven by the needs of developers\n- **Simplicity**: by keeping things simple, GraphQL Server is easier to use, easier to contribute to, and more secure\n- **Performance**: GraphQL Server is well-tested and production-ready - no modifications needed\n\nAnyone is welcome to contribute to GraphQL Server, just read [CONTRIBUTING.md](https://github.com/apollographql/apollo-server/blob/main/CONTRIBUTING.md), take a look at the [roadmap](https://github.com/apollographql/apollo-server/blob/main/ROADMAP.md) and make your first PR!\n","readmeFilename":"README.md","_id":"apollo-server-koa@2.26.2","_nodeVersion":"12.22.7","_npmVersion":"lerna/3.22.1/node@v12.22.7+x64 (linux)","dist":{"integrity":"sha512-MWpgCY6WoAp2Q5YCbyLjmn4do8qZyCg56W6NolH3dOpCdBg9xlch3lZqhJle47vNnlhNCcA8x61/btKUF51UJw==","shasum":"40f40b4c53f172e7906a56061c42803e12cfcfc4","tarball":"http://registry-npm.ywwl.com/apollo-server-koa/download/apollo-server-koa-2.26.2.tgz","fileCount":22,"unpackedSize":62344,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIBS0Brbry9n3SnP6CSA4YTbTCvXElbu9lijGejtSjUlgAiBDUhiql2gdfUwWRL8xBFH4GNYbPqDhFPgWbc9KD5daCQ=="}],"size":14877,"noattachment":false,"key":"/apollo-server-koa/-/apollo-server-koa-2.26.2.tgz"},"_npmUser":{"name":"apollo-bot","email":"npm@apollographql.com"},"directories":{},"maintainers":[{"name":"apollo-bot","email":"npm@apollographql.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/apollo-server-koa_2.26.2_1693429372824_0.3384889800519606"},"_hasShrinkwrap":false,"deprecated":"The `apollo-server-koa` package is part of Apollo Server v2 and v3, which are now end-of-life (as of October 22nd 2023 and October 22nd 2024, respectively). This package's functionality is now found in the `@apollo/server` package. See https://www.apollographql.com/docs/apollo-server/previous-versions/ for more details.","publish_time":1693429373142,"_cnpm_publish_time":1693429373142,"dist-tags":{"alpha":"3.6.0-alpha.1","alphalambda":"3.0.0-lambda.0","html":"3.0.0-html.2","latest":"3.13.0","next":"3.2.0","next-v3":"3.0.0-alpha.3","preview":"3.0.0-preview.4","rc":"3.0.0-rc.1","unified":"2.23.1-unified2.3","v2":"2.26.2"}}