{"bugs":{"url":"https://github.com/apollographql/apollo-server/issues"},"dist":{"shasum":"5d0b5bf7c3253c659481a1f2e5a3587a2f1ebd18","tarball":"https://registry.npmjs.org/apollo-server-koa/-/apollo-server-koa-1.3.5.tgz","fileCount":11,"integrity":"sha512-1fAWRSc32EesI/Up1Ski1ZpfdsKkLK86XYLW9ktLpDqDQd0qGAJvdPUDj0Q4eftwjLCRVTGJsmq0wR4PdFp4nA==","signatures":[{"sig":"MEQCIG7gBM7Jv8rbnhC1NwRK9p9YlYAWclOfwptzK2qEI9wbAiA4NOp9gKc2eICZMKWSb5cRH1bYkTdV1JZKQ27oW816ww==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":12863,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJa10PDCRA9TVsSAnZWagAArocP/35bwiVAtrfIgN1KI5ku\nh9WLTu5MduZkQOhZojd8zMz9veZxf8YBYVahAvS1xcINACUrXgto/DeUYKWc\nii7ZGHLmCzZFrheKREmkRBgy9rnNOgCH7urL9kFhxxuVNCFVxkjbMwx9uIMw\nSf16nuW56dn1QYqkN2JaC8pMJeRxVGH5VtMM0sO7GUq2c1LOo49MhtSJvfhI\nHp+CccnLACmJQrZXcIGYLDXlYN9q6EqY4DYTMhxRkcgzhEzWTQGYBEfPq3Uf\nJRg13ZBp6H/gwbQ1sFJV7YAdUks3sjXeNj2rG6GimYxvx9+s0Kn2XOqYzdto\nP07d8Y67oUt4j8h3AKrS1ukD7yQ614LbLGSmdOUdq6LjyjrhibaCHdDFGga6\nfmHaHe0Jm/dcp7CdWbryhZYBDhIvB4jDNWFAQPw2zZvTycLYj9duYI8zngCw\nuFbCHU38A5kZTYLs/UPPX6uv38rQL6iUcgR5lJfo6Bims+yQylVx3TspH4fs\n1HoMt8qxGy4V1qTaO4CowQEWsz1rPigj12T/gQb92Hg/gdK0EvCNtAv/MxuE\n7F62mT5hOKp4z+XfZ0pAgqsI42vrz0FqXRYqlMteRKMGsez6V6svUmfHy5bI\nYpv+iICGIojeRZww8K13QMO+JN67xTjyC8cQg9vhfT9z026oaqBisgHtre7o\nV4K3\r\n=oRj1\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/index.js","name":"apollo-server-koa","author":{"name":"Jonas Helfer","email":"jonas@helfer.email"},"readme":"---\ntitle: Koa\ndescription: Setting up Apollo Server with Koa\n---\n\n[![npm version](https://badge.fury.io/js/apollo-server-core.svg)](https://badge.fury.io/js/apollo-server-core) [![Build Status](https://circleci.com/gh/apollographql/apollo-cache-control-js.svg?style=svg)](https://circleci.com/gh/apollographql/apollo-cache-control-js) [![Coverage Status](https://coveralls.io/repos/github/apollographql/apollo-server/badge.svg?branch=master)](https://coveralls.io/github/apollographql/apollo-server?branch=master) [![Get on Slack](https://img.shields.io/badge/slack-join-orange.svg)](https://www.apollographql.com/#slack)\n\nThis is the Koa integration of Apollo Server. Apollo Server is a community-maintained open-source Apollo Server that works with all Node.js HTTP server frameworks: Express, Connect, Hapi, Koa and Restify. [Read the docs](https://www.apollographql.com/docs/apollo-server/). [Read the CHANGELOG.](https://github.com/apollographql/apollo-server/blob/master/CHANGELOG.md)\n\n```sh\nnpm install apollo-server-koa\n```\n\n## Usage\n\n```js\nimport koa from 'koa'; // koa@2\nimport koaRouter from 'koa-router';\nimport koaBody from 'koa-bodyparser';\nimport { graphqlKoa } from 'apollo-server-koa';\n\nconst app = new koa();\nconst router = new koaRouter();\nconst PORT = 3000;\n\n// koaBody is needed just for POST.\napp.use(koaBody());\n\nrouter.post('/graphql', graphqlKoa({ schema: myGraphQLSchema }));\nrouter.get('/graphql', graphqlKoa({ schema: myGraphQLSchema }));\n\napp.use(router.routes());\napp.use(router.allowedMethods());\napp.listen(PORT);\n```\n\n### GraphiQL\n\nYou can also use `apollo-server-koa` for hosting the [GraphiQL](https://github.com/graphql/graphiql) in-browser IDE. Note the difference between `graphqlKoa` and `graphiqlKoa`.\n\n```js\nimport { graphiqlKoa } from 'apollo-server-koa';\n\n// Setup the /graphiql route to show the GraphiQL UI\nrouter.get(\n  '/graphiql',\n  graphiqlKoa({\n    endpointURL: '/graphql', // a POST endpoint that GraphiQL will make the actual requests to\n  }),\n);\n```\n\nIn case your GraphQL endpoint is protected via authentication, or if you need to pass other custom headers in the request that GraphiQL makes, you can use the [`passHeader`](https://github.com/apollographql/apollo-server/blob/v1.0.2/packages/apollo-server-module-graphiql/src/renderGraphiQL.ts#L17) option – a string that will be added to the request header object.\n\nFor example:\n\n```js\nimport { graphiqlKoa } from 'apollo-server-koa';\n\nrouter.get(\n  '/graphiql',\n  graphiqlKoa({\n    endpointURL: '/graphql',\n    passHeader: `'Authorization': 'Bearer lorem ipsum'`,\n  }),\n);\n```\n\n## Principles\n\nApollo Server is built with the following principles in mind:\n\n* **By the community, for the community**: Apollo Server's development is driven by the needs of developers\n* **Simplicity**: by keeping things simple, Apollo Server is easier to use, easier to contribute to, and more secure\n* **Performance**: Apollo Server is well-tested and production-ready - no modifications needed\n\nAnyone is welcome to contribute to Apollo Server, just read [CONTRIBUTING.md](https://github.com/apollographql/apollo-server/blob/master/CONTRIBUTING.md), take a look at the [roadmap](https://github.com/apollographql/apollo-server/blob/master/ROADMAP.md) and make your first PR!\n","license":"MIT","scripts":{"compile":"tsc","prepublish":"npm run compile"},"typings":"dist/index.d.ts","_npmUser":{"name":"mdg","email":"npm@meteor.com"},"homepage":"https://github.com/apollographql/apollo-server#readme","keywords":["GraphQL","Apollo","Koa","Server","Javascript"],"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.","repository":{"url":"https://github.com/apollographql/apollo-server/tree/master/packages/apollo-server-koa","type":"git"},"typescript":{"definition":"dist/index.d.ts"},"_npmVersion":"5.8.0","description":"Production-ready Node.js GraphQL server for Koa","directories":{},"maintainers":[{"name":"abernix","email":"npmjs@jro.cc"},{"name":"freiksenet","email":"freiksenet@gmail.com"},{"name":"martijnwalraven","email":"martijn@martijnwalraven.com"},{"name":"mdg","email":"npm@meteor.com"},{"name":"sashko","email":"s.stubailo@gmail.com"}],"_nodeVersion":"4.8.7","dependencies":{"apollo-server-core":"^1.3.5","apollo-server-module-graphiql":"^1.3.4"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"koa":"2.5.0","@types/koa":"2.0.45","koa-router":"7.4.0","@types/graphql":"0.12.7","koa-bodyparser":"4.2.0","@types/koa-router":"7.0.27","@types/koa-bodyparser":"4.2.0","apollo-server-integration-testsuite":"^1.3.5"},"_npmOperationalInternal":{"tmp":"tmp/apollo-server-koa_1.3.5_1524057026905_0.7223761530743675","host":"s3://npm-registry-packages"},"_id":"apollo-server-koa@1.3.5","version":"1.3.5"}