{"id":13799988,"url":"https://github.com/expo/koa-graphiql","last_synced_at":"2025-07-01T10:04:43.597Z","repository":{"id":66122685,"uuid":"47153717","full_name":"expo/koa-graphiql","owner":"expo","description":"Koa middleware to display GraphiQL, the interactive GraphQL UI","archived":false,"fork":false,"pushed_at":"2017-08-06T12:31:06.000Z","size":7,"stargazers_count":27,"open_issues_count":2,"forks_count":6,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-06-13T13:58:15.706Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/expo.png","metadata":{"files":{"readme":"README.md","changelog":null,"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}},"created_at":"2015-11-30T23:58:20.000Z","updated_at":"2019-05-05T11:40:32.000Z","dependencies_parsed_at":"2024-01-26T21:02:37.578Z","dependency_job_id":"48498ac0-db61-4a95-816b-85a32fb23eaa","html_url":"https://github.com/expo/koa-graphiql","commit_stats":null,"previous_names":["exponentjs/koa-graphiql"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/expo/koa-graphiql","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/expo%2Fkoa-graphiql","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/expo%2Fkoa-graphiql/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/expo%2Fkoa-graphiql/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/expo%2Fkoa-graphiql/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/expo","download_url":"https://codeload.github.com/expo/koa-graphiql/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/expo%2Fkoa-graphiql/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259804841,"owners_count":22913901,"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":[],"created_at":"2024-08-04T00:01:07.951Z","updated_at":"2025-07-01T10:04:43.564Z","avatar_url":"https://github.com/expo.png","language":"JavaScript","funding_links":[],"categories":["仓库"],"sub_categories":["中间件"],"readme":"# koa-graphiql\n\nKoa middleware to display [GraphiQL](https://github.com/graphql/graphiql). Designed for Koa 2.\n\n## Usage\n\n```sh\nnpm i --save koa-graphiql\n```\n\nAdd it to your Koa app. You may want to use router middleware if your app serves more than GraphiQL.\n\n```js\nimport graphiql from 'koa-graphiql';\n\nrouter.get('/graphiql', graphiql(async (ctx) =\u003e {\n  return {\n    // String of the base URL of the GraphQL endpoint\n    url: '/graphql',\n\n    // String to display in the query panel\n    query: 'query Demo($token: String) { viewer(token: $token) { id } }',\n\n    // Object used to populate the \"variables\" panel\n    variables: {\n      token: 'eyJhbGciOiJIUzI1NiJ9.YWNjb3VudFtpZGVd.-w3FiHaq5jIFIOzHErgdEQGvXXG6wClBUDFDVgwUyx8'\n    },\n\n    // Object to display in the result panel\n    result: {\n      data: {\n        viewer: { id: 'account[ide]' }\n      }\n    },\n  };\n}));\n```\n\nTypically, you will want to populate the `query`, `variables`, and `result` fields from data in the Koa context, such as the query parameters or request body. `koa-graphiql` will do this for you by default.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fexpo%2Fkoa-graphiql","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fexpo%2Fkoa-graphiql","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fexpo%2Fkoa-graphiql/lists"}