{"id":15065902,"url":"https://github.com/oneqljs/oneql","last_synced_at":"2025-09-21T23:42:38.432Z","repository":{"id":57314644,"uuid":"175118907","full_name":"oneqljs/oneQL","owner":"oneqljs","description":"简单、轻量的 Nodejs服务端 Graphql 渐进式解决方案","archived":false,"fork":false,"pushed_at":"2019-07-26T05:57:12.000Z","size":3401,"stargazers_count":13,"open_issues_count":0,"forks_count":2,"subscribers_count":3,"default_branch":"dev","last_synced_at":"2025-04-02T07:35:24.007Z","etag":null,"topics":["apollo-graphql","apollo-graphql-server","graphql","graphql-framework","graphql-server","koa","koa2","nodejs","nodejs-framework"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/oneqljs.png","metadata":{"files":{"readme":"README.MD","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-03-12T02:23:15.000Z","updated_at":"2024-01-22T02:56:03.000Z","dependencies_parsed_at":"2022-09-12T15:01:51.853Z","dependency_job_id":null,"html_url":"https://github.com/oneqljs/oneQL","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oneqljs%2FoneQL","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oneqljs%2FoneQL/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oneqljs%2FoneQL/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oneqljs%2FoneQL/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/oneqljs","download_url":"https://codeload.github.com/oneqljs/oneQL/tar.gz/refs/heads/dev","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248225869,"owners_count":21068078,"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":["apollo-graphql","apollo-graphql-server","graphql","graphql-framework","graphql-server","koa","koa2","nodejs","nodejs-framework"],"created_at":"2024-09-25T00:57:17.277Z","updated_at":"2025-09-21T23:42:33.405Z","avatar_url":"https://github.com/oneqljs.png","language":"TypeScript","readme":"\u003cimg src=\"./doc/oneql_text_left.png\" width=\"400px\" /\u003e\n\n\noneQL\n--------\nUse koa + apollo-server-koa \u003cbr/\u003e\nbook: (https://oneqljs.github.io/oneQL/book/)\n\n[![npm][npm]][npm-url]\n[![node][node]][node-url]\n[![Downloads][downloads-image]][npm-url]\n[![GitHub license](https://img.shields.io/badge/license-MIT-lightgrey.svg?maxAge=2592000)]()\n\nGetting Started\n---------\n- npm install oneql-init -g\n- oneql-init project\n- cd project \u0026\u0026 npm install \u0026\u0026 npm run dev\n\n#### Init oneQL (oneql-init create boilerplate)\n\n```sh\n// src/index.ts\nimport oneql from 'oneql'\n\nimport typeDefs from './types'\nimport resolvers from './resolvers'\n\nnew oneql({\n    schema: {\n        typeDefs,\n        resolvers\n    },\n    context: async ({ ctx }) =\u003e {\n        return {\n            ctx\n        }\n    }\n})\n```\n\n#### Example:\n- Open：(http://localhost:3600/graphql)\n\n```js\nquery db($key: String, $ext: [ExtensionType]){\n  hello\n  city(request: {key: $key,  ext: $ext } ) {\n    datainfo{\n      CountryId\n      country\n      type\n    }\n  }\n}\n```\n\n##### QUERY VARIABLES\n```js\n{\"key\":\"D\", \"ext\": [{ \"key\":\"2\", \"value\":\"1\"}] }\n```\n\n![avatar](./doc/oneQL-example.png)\n\n\n```js\nquery simple{\n  seatSimple {\n    resultList{\n      fInfo{\n        fNo\n      }\n    }\n  }\n}\n```\n\n开发建议\n----------\n- 一个请求可以带多个schema，对应请求逻辑是resolvers文件夹下index.js, connect所有resolvers\n- 每一个最外层schema分一个对应的types文件和一个resolvers文件\n- types文件夹下index.js , connect所有types\n- 每一个schema具体数据实现，如果涉及请求，建议api文件夹里建一个文件处理逻辑\n\n\nUtil\n------------\n+ util提供了soa请求封装，如自动处理埋点信息；\n+ 提供xconfig集成；\n+ 提供redis方法集成\n+ 提供log方法集成\n\nProduction Environment\n-------\n- close graphlQL playground\n- app.config.js, env=prod // close \n\n```js\nconst server = new ApolloServer({\n  typeDefs,\n  // mocks\n  resolvers\n  // playground: false  // false为关闭\n})\n```\n\nMind map\n--------\n![avatar](./doc/oneQL_n.png)\n\n[npm]: https://img.shields.io/npm/v/oneql.svg\n[npm-url]: https://npmjs.com/package/oneql\n\n[node]: https://img.shields.io/node/v/oneql.svg\n[node-url]: https://nodejs.org\n\n[downloads-image]: https://img.shields.io/npm/dm/oneql.svg\n\nLicense\n------\nMIT","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foneqljs%2Foneql","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Foneqljs%2Foneql","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foneqljs%2Foneql/lists"}