{"_id":"@crystallize/koa-middleware-apollo","_rev":"14-136edafd855cf72d167f3151f86fa354","name":"@crystallize/koa-middleware-apollo","dist-tags":{"latest":"0.2.0"},"versions":{"0.1.0":{"name":"@crystallize/koa-middleware-apollo","version":"0.1.0","description":"Apollo server implementation that uses the traditional koa middleware pattern","repository":{"type":"git","url":"git+https://github.com/CrystallizeAPI/koa-middleware-apollo.git"},"main":"index.js","author":{"name":"Michael Smesnik","email":"michael@snowball.digital"},"license":"MIT","scripts":{"lint":"standard","format":"prettier-standard \"index.js\" \"test/*.js\"","test":"NODE_ENV=test mocka test/*.js"},"husky":{"hooks":{"pre-commit":"npm run lint"}},"standard":{"globals":["describe","it","expect"]},"devDependencies":{"@tailored-apps/helpers":"^1.1.1","chai":"^4.2.0","husky":"^1.2.0","mocha":"^6.0.0","prettier-standard":"^9.1.1","sinon":"^7.2.4","standard":"^12.0.1"},"dependencies":{"@apollographql/graphql-playground-html":"^1.6.6","apollo-server-core":"^2.4.6","graphql":"^14.1.1"},"gitHead":"ae2f6b1f6411aca77e85f7d65c15ca7b1e3901ae","bugs":{"url":"https://github.com/CrystallizeAPI/koa-middleware-apollo/issues"},"homepage":"https://github.com/CrystallizeAPI/koa-middleware-apollo#readme","_id":"@crystallize/koa-middleware-apollo@0.1.0","_nodeVersion":"10.15.1","_npmVersion":"6.7.0","dist":{"integrity":"sha512-eK6DSyDKBU0KWohZMfyfYCnHzZWQPScLZm6WFC4NdYHzt1IiXzM9IGe/d04VjuZcfersKI4l5ScbMgmEYBqd2g==","shasum":"7726ccd14a83ce13d46dd10f8387008fde028a39","tarball":"https://registry.npmjs.org/@crystallize/koa-middleware-apollo/-/koa-middleware-apollo-0.1.0.tgz","fileCount":9,"unpackedSize":144355,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcc8DYCRA9TVsSAnZWagAAinQP/2OPcfgeBVNByh2+iw7Z\nfbzMS8kD648HYS48iqkVzYaBmfCzZlqnwyZEXSNjlXsb9E2ncSYOAzXeMRu3\nuEVnY/VtcdNQBL0pBBUBPn5IisxyuZtnGcd916faC7F2jNiq3qR16Qe1iKch\n94X9C617oGq77aLhrdVG1hTTxWrYosMYdk0VUHlPRGybzssRVuN2Zt7mWX4X\nfomkW4rKxfZGAZ0f/P7bIbBrKM+fT/2q9RKykaw0E81WTn0yf4d8pLq+Rqi7\nSabYybsLJS5YJgUQXQD2uf2yAjcw8MJ3JTpAUXg4yKKknxW9a/fiYUUZ7ruG\nSbSL3hKLqiHp0V8ucj3535xaYIOf+EgFO6ofki2NkX/OGwkgLOfzjlWUInNd\nnuGELkpjv45Um2kRYelMfyZFZXThDzqMzEkTO04ruzksaeOBB8OROQroECFq\ns+KF6xaEuEv567bh2uXAsLOcC0riFI6AoWnK14DWjdY1xd4Gmv2JGWY4J580\nllRVBTvf4OqKI6JiXvpONX6+RKqlPxcf0YKHDvEa/EtCmH8aenoTAB5YUaz3\nIEsr95I2fhrv9bigxtg4obnY5/TU4stTNp3+Tc15Cmd7z0tFjcO3geQpiES2\npSB/Nzs81dlCZg3ghKRBYV8ZaZ8DPLc//f/FCotzfp3Rz5alTuH+Gbw+hkdk\nSqVk\r\n=FKun\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCJIfm2OgsKusiHMNHGtpjtssydwatZYRk7Oa4BO9qbswIgYWeCpohR2U+CY1A+Z6f5AS8kM5/12tDjS1j8PeSrMcM="}]},"maintainers":[{"name":"crystallize","email":"hello@crystallize.com"}],"_npmUser":{"name":"crystallize","email":"hello@crystallize.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/koa-middleware-apollo_0.1.0_1551089879867_0.9701693338121835"},"_hasShrinkwrap":false},"0.1.1":{"name":"@crystallize/koa-middleware-apollo","version":"0.1.1","description":"Apollo server implementation that uses the traditional koa middleware pattern","repository":{"type":"git","url":"git+https://github.com/CrystallizeAPI/koa-middleware-apollo.git"},"main":"index.js","author":{"name":"Michael Smesnik","email":"michael@snowball.digital"},"license":"MIT","scripts":{"lint":"standard","format":"prettier-standard \"index.js\" \"test/*.js\"","test":"NODE_ENV=test mocka test/*.js"},"husky":{"hooks":{"pre-commit":"npm run lint"}},"standard":{"globals":["describe","it","expect"]},"devDependencies":{"@tailored-apps/helpers":"^1.1.1","chai":"^4.2.0","husky":"^1.2.0","mocha":"^6.0.0","prettier-standard":"^9.1.1","sinon":"^7.2.4","standard":"^12.0.1"},"dependencies":{"@apollographql/graphql-playground-html":"^1.6.6","apollo-server-core":"^2.4.6","graphql":"^14.1.1"},"gitHead":"2fad862ad5121d2b59f0b9647dce24644859095b","bugs":{"url":"https://github.com/CrystallizeAPI/koa-middleware-apollo/issues"},"homepage":"https://github.com/CrystallizeAPI/koa-middleware-apollo#readme","_id":"@crystallize/koa-middleware-apollo@0.1.1","_nodeVersion":"10.15.1","_npmVersion":"6.7.0","dist":{"integrity":"sha512-G4s2PgXSXEgrzDVtTBrJTRZjPNHUpWOEF0OBYXh9IIzgPDn6oAxF+g9wXlrS2z1nfwo6rjofgugFznL78AV3EQ==","shasum":"245ca6c74fed15612b7b0fc4de5ac20afb9d66dd","tarball":"https://registry.npmjs.org/@crystallize/koa-middleware-apollo/-/koa-middleware-apollo-0.1.1.tgz","fileCount":9,"unpackedSize":144402,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcc8HtCRA9TVsSAnZWagAA9+0QAKAIciw8KyZ7FaYqjzEA\n0SxM34tzbNo8bWo+ACh9Gn2WVoA1PgJoO8giGDkQSDsgcNtrmbhjglfKtUSi\nPQS8yqM75OBwhgJbqBjj9uBLbUSvh++S3gaPB2rGk+xfpH8Fzs9FqbvT4AMP\n/4WmD5lCvX5j4a1r6IhkB0sKJnso2qrQeV0ATSWBjjwNkpS4ZEaCK9oCwTC0\nOevu9BnIjW2PIF6+ViMT0r6OL6JvrUDr+oFG97gEGxd/7HdW164sE0OX1I31\n/+iikzzB/V+zWYXkwePcpEbFUPTDP/LujjbPSISqF04n/tMDCG5NsfJ6ruZn\nr+bcdl7eHDoxoOBpH9JPtm3UyNPnjOLJ/MBIxFbhtWLeK1AIwjHT3rjWBS0u\nGKyWNaoHdUc/ZFrRydFb0wJcXqfy9L8Mg4U2FJDgj6xtekKMdrTp74eZ93eW\nEraJwKet0xU7CPDC5ncIwMZEVapKphYw4+oO/OQJ7RgYsJ6EQicYfu/ni0W6\nSqTchIWmJmcsGjqpk6EgUlDHngOfnaWPBvo8AFe6UqFPLVsCuPalzianYbS2\nUPZGBuy5R/2dMNuTFjaLUjZmiasm2K/+0t1aabmxPMVfmHVrJLlR1sIE1nKY\n+UZ/cZZG15P7VpX1XCwC+wU493dljxUiZtT4ZQDWpijRLl3V7UdSE9NmT2Kz\nodE5\r\n=kfCg\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIDEMxzHLwDMfE+dX4i0BkcQL7Xxva5scyn1HLQ26fRhmAiBmw0yz2Ch2SYo3E4qbSiPyTmTRdRcijE0YltOxCLvxOg=="}]},"maintainers":[{"name":"crystallize","email":"hello@crystallize.com"}],"_npmUser":{"name":"crystallize","email":"hello@crystallize.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/koa-middleware-apollo_0.1.1_1551090157049_0.728003274377151"},"_hasShrinkwrap":false},"0.1.2":{"name":"@crystallize/koa-middleware-apollo","version":"0.1.2","description":"Apollo server implementation that uses the traditional koa middleware pattern","repository":{"type":"git","url":"git+https://github.com/CrystallizeAPI/koa-middleware-apollo.git"},"keywords":["graphql","koa","middleware","crystallize"],"main":"index.js","author":{"name":"Michael Smesnik","email":"michael@snowball.digital"},"license":"MIT","scripts":{"lint":"standard","format":"prettier-standard \"index.js\" \"test/*.js\"","test":"NODE_ENV=test mocka test/*.js"},"husky":{"hooks":{"pre-commit":"npm run lint"}},"standard":{"globals":["describe","it","expect"]},"devDependencies":{"@tailored-apps/helpers":"^1.1.1","chai":"^4.2.0","husky":"^1.2.0","mocha":"^6.0.0","prettier-standard":"^9.1.1","sinon":"^7.2.4","standard":"^12.0.1"},"dependencies":{"@apollographql/graphql-playground-html":"^1.6.6","apollo-server-core":"^2.4.6","graphql":"^14.1.1"},"gitHead":"064cb7aa526d0eb79247db6668a96555bab337db","bugs":{"url":"https://github.com/CrystallizeAPI/koa-middleware-apollo/issues"},"homepage":"https://github.com/CrystallizeAPI/koa-middleware-apollo#readme","_id":"@crystallize/koa-middleware-apollo@0.1.2","_nodeVersion":"10.15.1","_npmVersion":"6.7.0","dist":{"integrity":"sha512-zlRlgfgp+jdYpYu9t49kW8WPtheXSuz+xdyMQkSquWKrOxX/77R/A1r9G+a+NRg7K7bVGU7WkjuddO7UVxDuNQ==","shasum":"60736a72df135b16684baf4eba1973ac3e42f870","tarball":"https://registry.npmjs.org/@crystallize/koa-middleware-apollo/-/koa-middleware-apollo-0.1.2.tgz","fileCount":9,"unpackedSize":144485,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcc8Q5CRA9TVsSAnZWagAAeWEP+weQDyPzyq2QJKyPp3YJ\ntoYJEKlyBaIBEqFczBHgWnSKoT2xVz5FjR6qD4YR0s8jWsB37PH0P2iSQ+38\nttMX07F+Anxszx7b65FMc92ST8iz68CdD/wNQdfjRuGJZ3DyFulwg5pse+Q8\nx1B7xHwkztobd3rXrvPmU0WiTgmdaKg3h9Pmx9BceBfpxxWE6xoVpCROXlPE\nAnQpfn9Kt1eeTx48fm1HL0ZON/sbA7ZnCsNxkgcJ3D5ogCFy94yDCEY4fcy4\nK4EG8TWZw1WS0A8asLGpe3jfiCjghLywQQ93QtWZu9/1azWXFdFZsJmNTORa\n0gIXfzkKdb7du9Fxr/WACTPPAJHgm5CO1RS/G+qgXdFJg8jgUhb19uW8fBO1\nAQuOvrHoRnlnr3526yOuwP3emLpoE6Vum4GN3ww1lWx1urof0NjxuZwgT4Xj\nvbDRIzdX1Hxu27Ts8y3MimtlZkX19JS3aR+/4wSFzoMFRh8Kr25lZa54gkqb\n9mO1WDCy1fXrMZpHCNIHW1Nsoztci+4uJfrVMo/RlLHn+5445XI+5X+75xdA\n6QxsG54aAxk+O7jzOVqCvM/KAI711U1Awgm/AvkqzHo7mA2I5XYGcABXfPRT\nBhnzEbK3zH5Csn9yPsaZCGWNhyFnnE4fV5qHql1jQGwuKtUwLzK/cnrToICb\n9C4w\r\n=Ij0H\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBNbWoo9JGqoEYctNPgFWyuY2/WCTwVuj08qyXGw0Fp1AiEAy+KXlccHdGEcFCmwJGLdRvJz0R4Mfae9YrNarYa1qw8="}]},"maintainers":[{"name":"crystallize","email":"hello@crystallize.com"}],"_npmUser":{"name":"crystallize","email":"hello@crystallize.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/koa-middleware-apollo_0.1.2_1551090744444_0.35172490747262564"},"_hasShrinkwrap":false},"0.1.3":{"name":"@crystallize/koa-middleware-apollo","version":"0.1.3","description":"Apollo server implementation that uses the traditional koa middleware pattern","repository":{"type":"git","url":"git+https://github.com/CrystallizeAPI/koa-middleware-apollo.git"},"keywords":["graphql","koa","middleware","crystallize"],"main":"index.js","author":{"name":"Michael Smesnik","email":"michael@snowball.digital"},"license":"MIT","scripts":{"preversion":"npm run lint && npm run test","lint":"standard","format":"prettier-standard \"index.js\" \"test/*.js\"","test":"NODE_ENV=test mocha test/*.js"},"husky":{"hooks":{"pre-commit":"npm run lint"}},"standard":{"globals":["describe","it","expect"]},"devDependencies":{"@tailored-apps/helpers":"^1.1.1","chai":"^4.2.0","husky":"^1.2.0","mocha":"^6.0.0","prettier-standard":"^9.1.1","sinon":"^7.2.4","standard":"^12.0.1"},"dependencies":{"@apollographql/graphql-playground-html":"^1.6.6","apollo-server-core":"^2.4.6","graphql":"^14.1.1"},"gitHead":"f17d3014e94ef140c8d9cd5ad1d459ee892d529c","bugs":{"url":"https://github.com/CrystallizeAPI/koa-middleware-apollo/issues"},"homepage":"https://github.com/CrystallizeAPI/koa-middleware-apollo#readme","_id":"@crystallize/koa-middleware-apollo@0.1.3","_nodeVersion":"10.15.1","_npmVersion":"6.7.0","dist":{"integrity":"sha512-XbGTiDho0Yk6auRW8dfUbNARSCHvPdn9McbitF6lsfaoKQXURsn0Nut3pg2s5cwZO6qj5eC55q8TmiCuRHrRAw==","shasum":"8e0db6df4f4e98d83ba497124d2fbd7d84a5b780","tarball":"https://registry.npmjs.org/@crystallize/koa-middleware-apollo/-/koa-middleware-apollo-0.1.3.tgz","fileCount":9,"unpackedSize":144535,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcc8VKCRA9TVsSAnZWagAArZ8P/1kwqITgUlV5l5ZEvqdU\ndvy9WbR5to2K3Va9Je4IH/6WJvT34tQWxRiLmFwIEh2NzGhweK57f5lc5t8i\nW2PDmpK866ap05DwOmfwNqzOYYG608C4XiaXE4DwONhLBQYNsudGs6lwdJJs\nlrBqOMCLmGvTcPypZtyTrRN9GHaS/zGNYkNexqnBmqFc113v6gy/zhx1unVN\nWe9286mVPlvuOEebGLmfNEvTpiiZOMGUwXhE8Q1++xKPIZerkaY1E/PHgLqn\nMww++rQz15VkXi0ryOLH45O2q56rS1vatQvOBsDJWBbYAlSnIbYtVTa9dzNY\nbOcv8wx8ycxURPHn9p0InYnIU8Tosg1JRl8OJwrr4aHzto0XaHc5AYYt9NPu\nqMAIZED6ooXdRi7AKESn3hrEd1p3opjLvfXOLiVIJkqMtE4mAWkD9+IJ8Yas\nyvJ2dgJDALMC2RjDvE5ff1yoioUUEKvcMtbozHGabXsSXjTJ27vC0PMsUg2w\n4iPPprb/t3EM9V0tms/cZubdRwelzNe49BxpWj4nX7rwMOeUjany7HCIRx3X\nUPpjNIvW493liZvtvD8cMhGIzZuRp8drzXuyT51yn1ZHCPKLLStkPsUaGtmR\n2XHz9Cx9YyhF8Vzv5bn/RAGzaG7r3AJRZUkUF7zcy4mC1EprJbL64gERF0RY\nLfpE\r\n=YZZR\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIDECZB6YdY9EQAfou7io1f21OoPH0C0PzH7wwBb9OCfSAiEAmesHSFAGqtm5JunTUBMqMoJT1wUjm4VB9gGtDC0b+2I="}]},"maintainers":[{"name":"crystallize","email":"hello@crystallize.com"}],"_npmUser":{"name":"crystallize","email":"hello@crystallize.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/koa-middleware-apollo_0.1.3_1551091018216_0.4786446703320526"},"_hasShrinkwrap":false},"0.2.0":{"name":"@crystallize/koa-middleware-apollo","version":"0.2.0","description":"Apollo server implementation that uses the traditional koa middleware pattern","repository":{"type":"git","url":"git+https://github.com/CrystallizeAPI/koa-middleware-apollo.git"},"keywords":["graphql","koa","middleware","crystallize"],"main":"index.js","author":{"name":"Michael Smesnik","email":"michael@snowball.digital"},"license":"MIT","scripts":{"preversion":"npm run lint && npm run test","lint":"standard","format":"prettier-standard \"index.js\" \"test/*.js\"","test":"NODE_ENV=test mocha test/*.js"},"husky":{"hooks":{"pre-commit":"npm run lint"}},"standard":{"globals":["describe","it","expect"]},"devDependencies":{"@tailored-apps/helpers":"^1.1.1","chai":"^4.2.0","husky":"^2.1.0","mocha":"^6.1.4","prettier-standard":"^9.1.1","sinon":"^7.3.2","standard":"^12.0.1"},"dependencies":{"apollo-server-core":"^2.4.8","graphql":"^14.2.1","graphql-playground-html":"^1.6.25"},"gitHead":"793047db146397b7b0a8aa86747872dc43003c95","bugs":{"url":"https://github.com/CrystallizeAPI/koa-middleware-apollo/issues"},"homepage":"https://github.com/CrystallizeAPI/koa-middleware-apollo#readme","_id":"@crystallize/koa-middleware-apollo@0.2.0","_nodeVersion":"12.16.0","_npmVersion":"6.13.4","dist":{"integrity":"sha512-AjnRvaOKTPcO5c1k6yuKZt9dBDN7BNmOIpDE4YRMfZx/tqrjcJzl6GLHXxVrm2gL2DGxhPm7CVYNN+H+nAhjqw==","shasum":"0ad07b08d2e26c6ab8cca9d0dbd06de57bb9ec60","tarball":"https://registry.npmjs.org/@crystallize/koa-middleware-apollo/-/koa-middleware-apollo-0.2.0.tgz","fileCount":8,"unpackedSize":14168,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfDwuZCRA9TVsSAnZWagAAJSoP/0tftIaCmkhwj1g48CLm\nX/ie8j6Gbbg5EWO3psbfKFfc+JP4gPAiMZKXk1SD1nhI0ms/RHzeJoq20twQ\n2Da3Fs7K/HDvNPA7VtdUSuinoMeDbgvKf5z2kXqZxwpg3LZ73XoRRhvxwzTT\nx/VOCYXR8oltNNt6Z7xm4/L/WikQ4cAzwKK3obbdJnhuyx3vCv5dLPaqAcAq\noDQX85exVthTETOB1dOFsCpAFTH1i4mxLONiD3RkY3mdqwdCuz3diRIPjS0T\nIIfoR9OgLs8iwD9eIgeiNuVMEYiGgAp+UxIrfg9scBFPI+cQsEVg7J5epPR0\n1mJsUjhsSdMPuG4kjYliC6f88ndH5+BObPj7p+z/NLimgghdON+20/l0jMio\ngqpcOV7KweFpoca0OvMgqN9/jjpQvVupUdQdSUqUdKAYof1b683jFWINWSO7\nglYu1tDYQXSsiQ75AOfG1xDMW3pCOqzupsq1I7xUNnFKfadD6J7edPt3iWV6\nHSOqpJhfv81rocVkvijI9DoN1lh7M11X1q0aP5V0s6ezayF8g2ZoS7QFmtRx\nWyRAT2PpZGos2NzN+jpT0seJvTCOQDBxroBTMM7IBY8OKiOXydnYSojoa9VW\nB4KfAgvAiYg/WzEAPgx8hj6jWhwT1i8/meCUFhVB1QaseH7Up/vHhS3TzHCb\n8kJN\r\n=jz8O\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIFcr59wrE8AeIryzxHgrjfl9expVCjnzpZkGsJX/X0PVAiEAjVpOtC5LM+3iWpgR8+/7+Gm4bHZ1+D72TyNqx/rfqt0="}]},"maintainers":[{"email":"hello@crystallize.com","name":"crystallize-admin"}],"_npmUser":{"name":"crystallize-admin","email":"hello@crystallize.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/koa-middleware-apollo_0.2.0_1594821529331_0.9034181814289794"},"_hasShrinkwrap":false}},"time":{"created":"2019-02-25T10:17:59.689Z","0.1.0":"2019-02-25T10:17:59.975Z","modified":"2022-04-05T02:00:44.687Z","0.1.1":"2019-02-25T10:22:37.256Z","0.1.2":"2019-02-25T10:32:24.679Z","0.1.3":"2019-02-25T10:36:58.360Z","0.2.0":"2020-07-15T13:58:49.422Z"},"maintainers":[{"email":"hello@crystallize.com","name":"crystallize-admin"}],"description":"Apollo server implementation that uses the traditional koa middleware pattern","homepage":"https://github.com/CrystallizeAPI/koa-middleware-apollo#readme","repository":{"type":"git","url":"git+https://github.com/CrystallizeAPI/koa-middleware-apollo.git"},"author":{"name":"Michael Smesnik","email":"michael@snowball.digital"},"bugs":{"url":"https://github.com/CrystallizeAPI/koa-middleware-apollo/issues"},"license":"MIT","readme":"# koa-middleware-apollo\n[![JavaScript Style Guide](https://img.shields.io/badge/code_style-standard-brightgreen.svg)](https://standardjs.com)\n\nApollo server implementation that uses the traditional koa middleware pattern. Heavily inspired by [apollo-server-koa](https://github.com/apollographql/apollo-server/tree/master/packages/apollo-server-koa).\n\n_This package is a work in progress and currently does not support file uploads or GraphQL subscriptions._\n\n## Motivation\nWhile the official implementation of the Apollo GraphQL server for koa, the [apollo-server-koa](https://github.com/apollographql/apollo-server/tree/master/packages/apollo-server-koa) package mentioned above, provides an easy way to get a GraphQL server up and running, it does not work the same way that other koa middleware does. Rather than adding a middleware function to the koa stack (via `app.use()`), `apollo-server-koa` exposes an `applyMiddleware` function on an instance of the `ApolloServer` class (see package documentation for further details). This can be problematic if you, for instance, want to use path parameters for your GraphQL endpoint (e.g. `/graph/:clientId`).\n\n`@crystallize/koa-middleware-apollo` exports middleware functions that integrate seamlessly into any koa middleware stack, thus providing better interoperability and allowing for greater customizability.   \n\n### Batteries not Included\nSince our aim is to integrate as seamlessly as possible into any middleware stack, we make as few assumptions as reasonably possible. Therefore, `@crystallize/koa-middleware-apollo` does not include a bodyparser, a router or anything other than the basic tools to run a GraphQL server. Contrary to `apollo-server-koa`, it also does not export [graphql-tools](https://github.com/apollographql/graphql-tools) or [apollo-server-core](https://www.npmjs.com/package/apollo-server-core), which means you will have to add that to your dependencies manually if you intend to use functionality provided by these packages (e.g. `makeExecutableSchema` or `gql` respectively).  \n\n## Installation\n```\nyarn add @crystallize/koa-middleware-apollo\n```\n\n## Basic GraphQL Server\n### `basicGraphqlServer(options[, dependencies]) -> Function`\nReturns middleware for a basic GraphQL server (implemented using `ApolloServerBase` from the [apollo-server-core](https://www.npmjs.com/package/apollo-server-core) package).\n\n* `options`: Configuration object that will be passed to the `ApolloServerBase` constructor\n* `dependencies` (optional): Allows for deeper customization of middleware behavior using dependency injection for various functions (default implementations shown here):\n  * `getMethod`: `ctx => ctx.request.method`\n  * `getQuery`: `ctx => ctx.request.body`\n  * `runQuery`: `runHttpQuery` (from `apollo-server-core`)\n  * `getOptions`: `ctx => apollo.graphQLServerOptions({ ctx })` (from `apollo-server-core`)\n  * `getRequest`: `ctx => convertNodeHttpToRequest(ctx.req)`\n\n#### Example\n```js\nconst { basicGraphqlServer } = require('@crystallize/koa-middleware-apollo')\n\nconst app = require('./app')\nconst schema = require('./schema')\n\nconst middleware = basicGraphqlServer({\n  schema,\n  debug: true,\n  context: ({ ctx }) => {\n   const { user } = ctx.state\n\n   return { user }\n  }\n})\n\napp.use(middleware)\n```\n\n### `graphqlServer(apollo[, dependencies]) -> Function`\nReturns middleware for a custom GraphQL server instance.\n\n* `apollo`: Instance of an `ApolloServer` class\n* `dependencies` (optional): See above\n\n## GraphQL Playground\n### `playground(options[, dependencies]) -> Function`\nReturns middleware for rendering a [GraphQL playground](https://www.apollographql.com/docs/apollo-server/features/graphql-playground.html) via the [@apollographql/graphql-playground-html](https://www.npmjs.com/package/@apollographql/graphql-playground-html) package.\n\n* `options`: Configuration object that will be passed directly to the playground render function. See [docs](https://github.com/prisma/graphql-playground#usage) for available options\n* `dependencies` (optional):\n  * `getEndpoint`: Returns the GraphQL server endpoint. Will receive koa `ctx` as its only parameter. Defaults to `options.endpoint`.\n  \n# Full Example\nThis is a close to real life example implementation of a basic GraphQL server at an endpoint that makes use of a path parameter.\n\n ```js\nconst Koa = require('koa')\nconst Router = require('koa-router')\nconst bodyParser = require('koa-bodyparser')\nconst {\n  basicGraphqlServer,\n  playground\n} = require('@crystallize/koa-middleware-apollo')\n\nconst schema = require('./schema')\n\nconst router = new Router()\n\nrouter.post(\n  '/graph/:clientId',\n  basicGraphqlServer({\n    schema,\n    context: ({ ctx }) => {\n      const { clientId } = ctx.params\n\n      return { clientId }\n    }\n  })\n)\n\nrouter.get(\n  '/graph/:clientId',\n  playground(\n    {\n      settings: {\n        'editor.theme': 'light'\n      }\n    },\n    {\n      getEndpoint: ctx => `/graph/${ctx.params.clientId}`\n    }\n  )\n)\n\nconst app = new Koa()\n\napp\n  .use(bodyParser())\n  .use(router.routes())\n\napp.listen(process.env.PORT || 3000)\n\n```\n\n# Author\n[Michael Smesnik](https://github.com/daerion) at [crystallize](https://crystallize.com)\n\n# License\nMIT\n","readmeFilename":"README.md","keywords":["graphql","koa","middleware","crystallize"]}