{"id":14989564,"url":"https://github.com/erkkah/tiny-graphql-koa","last_synced_at":"2025-08-04T05:34:24.240Z","repository":{"id":40367561,"uuid":"304254951","full_name":"erkkah/tiny-graphql-koa","owner":"erkkah","description":"Tiny GraphQL-serving middleware for Koa","archived":false,"fork":false,"pushed_at":"2023-05-10T14:23:30.000Z","size":369,"stargazers_count":6,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"main","last_synced_at":"2024-05-09T09:55:20.458Z","etag":null,"topics":["graphql","graphql-server","koa","koa-middleware"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"isc","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/erkkah.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-10-15T08:10:43.000Z","updated_at":"2024-03-28T02:08:20.000Z","dependencies_parsed_at":"2024-09-11T20:58:36.831Z","dependency_job_id":"4f76380f-c4ac-4926-b8e7-d4d2110d6ec5","html_url":"https://github.com/erkkah/tiny-graphql-koa","commit_stats":null,"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/erkkah%2Ftiny-graphql-koa","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/erkkah%2Ftiny-graphql-koa/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/erkkah%2Ftiny-graphql-koa/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/erkkah%2Ftiny-graphql-koa/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/erkkah","download_url":"https://codeload.github.com/erkkah/tiny-graphql-koa/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248505742,"owners_count":21115352,"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":["graphql","graphql-server","koa","koa-middleware"],"created_at":"2024-09-24T14:18:34.716Z","updated_at":"2025-04-12T01:41:12.974Z","avatar_url":"https://github.com/erkkah.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# tiny-graphql-koa\n\nA tiny GraphQL-serving middleware for Koa, built on the great [graphql-api-koa](https://github.com/jaydenseric/graphql-api-koa) middleware.\n\nReduces the steps to get up and running, and provides plugin support to extend the GraphQL server functionality.\n\nIncluded plugins:\n\n- [TracePlugin](./src/TracePlugin.ts) -- provides [Apollo Tracing](https://github.com/apollographql/apollo-tracing) support\n- [CachePlugin](./src/CachePlugin.ts) -- a full response cache\n- [LoggerPlugin](./src/LoggerPlugin.ts) -- base level logging plugin\n- [AuthPlugin](./src/AuthPlugin.ts) -- schema defined authorization levels\n- [LocalizationPlugin](./src/L10nPlugin.ts) -- query level localization directive\n\nYou can turn on the included [GraphQL playground](https://github.com/graphql/graphql-playground) by setting the `playgroundEndpoint` in the startup options.\n\n## Getting started\n\nInstall using npm:\n\n```console\n$ npm add tiny-graphql-koa\n```\n\nExample using plugins and the playground:\n\n```typescript\nimport Koa from \"koa\";\nimport gql from \"graphql-tag\";\n\nimport { makeServerMiddleware, CachePlugin, TracePlugin } from \"tiny-graphql-koa\";\n\nconst app = new Koa();\n\nconst graphqlServer = makeServerMiddleware({\n    typedefs: [\n        gql`\n            type Query {\n                version: String! @cache(ttl: SHORT)\n            }\n        `,\n    ],\n    resolvers: [\n        {\n            Query: {\n                version: () =\u003e \"1.2.3\"\n            }\n        }\n    ],\n    plugins: [new TracePlugin(), new CachePlugin()],\n    playgroundEndpoint: \"/playground\",\n});\n\napp.use(graphqlServer);\nconst server = app.listen(3000).on(\"listening\", () =\u003e {\n    console.log(\"Up and running at:\", server.address());\n});\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ferkkah%2Ftiny-graphql-koa","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ferkkah%2Ftiny-graphql-koa","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ferkkah%2Ftiny-graphql-koa/lists"}