{"id":13499155,"url":"https://github.com/jaydenseric/graphql-api-koa","last_synced_at":"2025-04-15T16:56:20.322Z","repository":{"id":41001650,"uuid":"133024258","full_name":"jaydenseric/graphql-api-koa","owner":"jaydenseric","description":"GraphQL execution and error handling middleware written from scratch for Koa.","archived":false,"fork":false,"pushed_at":"2022-11-06T23:56:15.000Z","size":297,"stargazers_count":52,"open_issues_count":1,"forks_count":7,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-03-28T22:41:45.514Z","etag":null,"topics":["api","graphql","koa","maintained","node","npm"],"latest_commit_sha":null,"homepage":"https://npm.im/graphql-api-koa","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jaydenseric.png","metadata":{"files":{"readme":"readme.md","changelog":"changelog.md","contributing":null,"funding":".github/funding.yml","license":"license.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null},"funding":{"github":"jaydenseric"}},"created_at":"2018-05-11T10:11:26.000Z","updated_at":"2024-02-02T18:23:13.000Z","dependencies_parsed_at":"2022-08-31T22:20:09.940Z","dependency_job_id":null,"html_url":"https://github.com/jaydenseric/graphql-api-koa","commit_stats":null,"previous_names":[],"tags_count":26,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jaydenseric%2Fgraphql-api-koa","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jaydenseric%2Fgraphql-api-koa/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jaydenseric%2Fgraphql-api-koa/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jaydenseric%2Fgraphql-api-koa/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jaydenseric","download_url":"https://codeload.github.com/jaydenseric/graphql-api-koa/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249116116,"owners_count":21215140,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["api","graphql","koa","maintained","node","npm"],"created_at":"2024-07-31T22:00:30.034Z","updated_at":"2025-04-15T16:56:20.274Z","avatar_url":"https://github.com/jaydenseric.png","language":"JavaScript","readme":"![graphql-api-koa logo](https://cdn.jsdelivr.net/gh/jaydenseric/graphql-api-koa@1.1.1/graphql-api-koa-logo.svg)\n\n# graphql-api-koa\n\n[GraphQL](https://graphql.org) execution and error handling middleware written from scratch for [Koa](https://koajs.com).\n\n## Installation\n\nTo install [`graphql-api-koa`](https://npm.im/graphql-api-koa) and its [`graphql`](https://npm.im/graphql) peer dependency with [npm](https://npmjs.com/get-npm), run:\n\n```sh\nnpm install graphql-api-koa graphql\n```\n\nSetup the Koa middleware in this order:\n\n1. [`errorHandler`](./errorHandler.mjs), to catch errors from following middleware for a correctly formatted [GraphQL response](https://spec.graphql.org/October2021/#sec-Errors).\n2. A [GraphQL multipart request](https://github.com/jaydenseric/graphql-multipart-request-spec) processor like `graphqlUploadKoa` from [`graphql-upload`](https://npm.im/graphql-upload), to support file uploads (optional).\n3. A request body parser like [`koa-bodyparser`](https://npm.im/koa-bodyparser).\n4. [`execute`](./execute.mjs), to execute GraphQL.\n\nSee the [`execute`](./execute.mjs) middleware examples to get started.\n\n## Requirements\n\nSupported runtime environments:\n\n- [Node.js](https://nodejs.org) versions `^14.17.0 || ^16.0.0 || \u003e= 18.0.0`.\n\nProjects must configure [TypeScript](https://typescriptlang.org) to use types from the ECMAScript modules that have a `// @ts-check` comment:\n\n- [`compilerOptions.allowJs`](https://typescriptlang.org/tsconfig#allowJs) should be `true`.\n- [`compilerOptions.maxNodeModuleJsDepth`](https://typescriptlang.org/tsconfig#maxNodeModuleJsDepth) should be reasonably large, e.g. `10`.\n- [`compilerOptions.module`](https://typescriptlang.org/tsconfig#module) should be `\"node16\"` or `\"nodenext\"`.\n\n## Exports\n\nThe [npm](https://npmjs.com) package [`graphql-api-koa`](https://npm.im/graphql-api-koa) features [optimal JavaScript module design](https://jaydenseric.com/blog/optimal-javascript-module-design). It doesn’t have a main index module, so use deep imports from the ECMAScript modules that are exported via the [`package.json`](./package.json) field [`exports`](https://nodejs.org/api/packages.html#exports):\n\n- [`errorHandler.mjs`](./errorHandler.mjs)\n- [`execute.mjs`](./execute.mjs)\n- [`GraphQLAggregateError.mjs`](./GraphQLAggregateError.mjs)\n","funding_links":["https://github.com/sponsors/jaydenseric"],"categories":["Libraries","Implementations"],"sub_categories":["JavaScript Libraries","JavaScript/TypeScript"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjaydenseric%2Fgraphql-api-koa","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjaydenseric%2Fgraphql-api-koa","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjaydenseric%2Fgraphql-api-koa/lists"}