{"bugs":{"url":"https://github.com/apollographql/apollo-server/issues"},"dist":{"shasum":"0f19f6ac3e906b25e81d72582beda91be7963fa1","tarball":"https://registry.npmjs.org/apollo-server-koa/-/apollo-server-koa-2.0.0-beta.9.tgz","fileCount":11,"integrity":"sha512-x/02WOtnZkYhZLBQ1wxuDrOR15NaBYa1lufNOYA8lAK+MrdXOIoRFVUTkuQOcgwRXB9iErl1YWV4edukSI3VjQ==","signatures":[{"sig":"MEUCIQDaHoB4RVWmME25dmVwVVDBgizVekFrcAc5/4NOjKQXIgIgGPAeNmH+aIUOubTs+DdKwcXKi86Wnr3Tc3P3+9XUgiQ=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":13390,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbIWboCRA9TVsSAnZWagAAfyoP/1ig8YPzfUiC57EqsTRy\nPmbt1PJswJLP7xx4rFhXZPLg+rF+yjW+DXba5MW8qyV0gBYqsGeOX+IBCLU9\nuBAZUmsYoTh2sgjLRuzAyFi1IYndkEcDqa53VG0x+/qdMm/pS6lcJIPvN4jq\n0WFRxNTrRpH9I0s36UtuejwMrQzKGplUaBlH+V80AeAPZNaEBSVJ6GGOvnDO\nCj1vfyslNFXUTOiSAURplcea8gkkt0NttwlLjTwOA8evfA51aicnCJzAFGsz\nRxDqYRLYS2H6VH+bymtb4b3HvOV6ollY5YjzWg7Az7wq0zvp1ytS8TOVuf08\n/sHkoDQnbymMSyJkMveldZ7fhhb7y1F9yIH9ncMVAPs6IjyqtygJJdTfVzWY\nAbRaWYnOwddWS7PorcevFEU+h2exS+fAy3rW1+QybdpSFd3E03kjxhY5kpN+\nqgu1bvkG4c0B7IaHqT2mMtw5+hzg62vTz56R6OFkKG2gOfblRpu/HwFQeJzD\ngg6mjaxpOw+o2yaXkVTxUAi+a3jn84joqITVTHQuMEg6YL3FNyW2X1YymK/C\n9XoT7V1m5QocoXo+MJSovj4V1N1ppVbaWdW1EZV5uz7Cz8X41O6r2VONIsG1\nTyXU42VV6YpUZVgIyZIWIQBqVrlOqSHNKUdUZqShV/FHyqqjeg56AAWuS5TK\n+6Ng\r\n=NDus\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","engines":{"node":">=8"},"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.6.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":"jbaxleyiii","email":"james@meteor.com"},{"name":"martijnwalraven","email":"martijn@martijnwalraven.com"},{"name":"mdg","email":"npm@meteor.com"},{"name":"sashko","email":"s.stubailo@gmail.com"}],"_nodeVersion":"9.5.0","dependencies":{"apollo-server-core":"^2.0.0-beta.9","apollo-server-module-graphiql":"^2.0.0-beta.8"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"koa":"2.5.1","@types/koa":"2.0.45","koa-router":"7.4.0","koa-bodyparser":"4.2.0","@types/koa-router":"7.0.28","@types/koa-bodyparser":"4.2.0","apollo-server-integration-testsuite":"^2.0.0-beta.9"},"_npmOperationalInternal":{"tmp":"tmp/apollo-server-koa_2.0.0-beta.9_1528915687282_0.1923395262513503","host":"s3://npm-registry-packages"},"_id":"apollo-server-koa@2.0.0-beta.9","version":"2.0.0-beta.9"}