{"name":"apollo-server-koa","version":"2.0.0-beta.8","description":"Production-ready Node.js GraphQL server for Koa","main":"dist/index.js","scripts":{"compile":"tsc","prepublish":"npm run compile"},"repository":{"type":"git","url":"https://github.com/apollographql/apollo-server/tree/master/packages/apollo-server-koa"},"keywords":["GraphQL","Apollo","Koa","Server","Javascript"],"author":{"name":"Jonas Helfer","email":"jonas@helfer.email"},"license":"MIT","bugs":{"url":"https://github.com/apollographql/apollo-server/issues"},"homepage":"https://github.com/apollographql/apollo-server#readme","engines":{"node":">=8"},"dependencies":{"apollo-server-core":"^2.0.0-beta.7","apollo-server-module-graphiql":"^2.0.0-beta.8"},"devDependencies":{"@types/koa":"2.0.45","@types/koa-bodyparser":"4.2.0","@types/koa-router":"7.0.28","apollo-server-integration-testsuite":"^2.0.0-beta.8","koa":"2.5.1","koa-bodyparser":"4.2.0","koa-router":"7.4.0"},"typings":"dist/index.d.ts","typescript":{"definition":"dist/index.d.ts"},"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","readmeFilename":"README.md","_id":"apollo-server-koa@2.0.0-beta.8","_npmVersion":"5.7.1","_nodeVersion":"8.9.4","_npmUser":{"name":"mdg","email":"npm@meteor.com"},"dist":{"integrity":"sha512-Wx2hmt3EbkY6dNN5Es8XyErIdT+hf1xg1xVT778IpTbS4+io9WfTFzoJTq7vPLZn24l3VwRMkTJVj4RcKeOJ2w==","shasum":"a88f213f29f5b32bb4500bcf37cff6a7d1eaf6f7","tarball":"http://registry-npm.ywwl.com/apollo-server-koa/download/apollo-server-koa-2.0.0-beta.8.tgz","fileCount":11,"unpackedSize":13390,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbIGuDCRA9TVsSAnZWagAAynsP+gL8Kb8VipqKmvsbLgnD\nWPpdwvz4nD5Cfz9mpY16a8XyDT4aIozlsVaXQbgTGB1sCnW2dj1acmOC6Afg\nII/MNW1Mm0ir6wEpxf2bWkQ8Eykr52fKcWmNmbHuNYJ6C8HTHNQNHFylE9UN\nE3XVTATMHbhZ9yS/RsKAfj029mAyamBUMoPUtpWKFVfoG8hPUV/9utJwRe4f\n14yM/g7QqiNDNg5hxNKGt1vU3RgTjqPCQncHDaXtnK5+/DAuhqt5PQEVPECS\nn0CVmjOUxcdAYZ01RNRdzRL4WmXWvVw2p7IkIspzdFr0qDNzf0/71SWjnnBy\nog6cnJu4B4kOLG3qCio7Ws3h2KQcxsyM/dy5NhG1uHCJZh6hY42Hox36hDm+\na3v+1kl/2pPQEAOCCOqumbbaCkufsKArFoQ4wPSni3RoMIYYNos3skl3FJnk\novcVXtu0CvFfBOe/r4RaOVr/dQh3tSvq4Q2XEGsXItTzR00C0JkLRfyQ1bh2\n2n2JWZXV8bSDeYsAyJJBjsqOxgydeF38oiJd32scrRivG1ziRY7KD4C5W2sL\nu8fFhL6M8DUSIx+SGYiU35brjWeB1Kb+X+4ZbrhOaEmyAReyHnDIC56Ep+QK\niega77OoEjqa15J48rVDfEFvgdfCbK85VYoHfqReUJx1CeLP/+OiLrh6fJuS\nAYH1\r\n=drJl\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCENTogu4RuLfksPWyEaTqS5uvm5RZmC/zZkCFXFOGw8gIhAK9M4vTB/ey/y9xjCRgQkSY98M92Xd6Y4bO5BGPKJwR2"}],"size":4367,"noattachment":false,"key":"/apollo-server-koa/-/apollo-server-koa-2.0.0-beta.8.tgz"},"maintainers":[{"email":"npmjs@jro.cc","name":"abernix"},{"email":"freiksenet@gmail.com","name":"freiksenet"},{"email":"james@meteor.com","name":"jbaxleyiii"},{"email":"martijn@martijnwalraven.com","name":"martijnwalraven"},{"email":"npm@meteor.com","name":"mdg"},{"email":"s.stubailo@gmail.com","name":"sashko"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/apollo-server-koa_2.0.0-beta.8_1528851330674_0.95951889372013"},"_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":1528851330742,"_cnpm_publish_time":1528851330742,"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"}}