{"id":21518490,"url":"https://github.com/sunxiuguo/koa-graphql-template","last_synced_at":"2025-04-09T22:04:24.902Z","repository":{"id":42094361,"uuid":"250152159","full_name":"sunxiuguo/Koa-GraphQL-Template","owner":"sunxiuguo","description":"This is a koa Graphql server template build with typescript, use type-graphql and typegoose","archived":false,"fork":false,"pushed_at":"2023-01-11T22:26:47.000Z","size":533,"stargazers_count":41,"open_issues_count":15,"forks_count":6,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-09T22:04:05.910Z","etag":null,"topics":["graphql","koa-graphql-template","koa2","mongodb","mongoose","nodejs","type-graphql","typegoose","typescript"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","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/sunxiuguo.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}},"created_at":"2020-03-26T03:29:32.000Z","updated_at":"2025-01-16T01:31:01.000Z","dependencies_parsed_at":"2023-02-09T08:30:54.490Z","dependency_job_id":null,"html_url":"https://github.com/sunxiuguo/Koa-GraphQL-Template","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/sunxiuguo%2FKoa-GraphQL-Template","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sunxiuguo%2FKoa-GraphQL-Template/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sunxiuguo%2FKoa-GraphQL-Template/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sunxiuguo%2FKoa-GraphQL-Template/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sunxiuguo","download_url":"https://codeload.github.com/sunxiuguo/Koa-GraphQL-Template/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248119296,"owners_count":21050755,"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","koa-graphql-template","koa2","mongodb","mongoose","nodejs","type-graphql","typegoose","typescript"],"created_at":"2024-11-24T00:52:21.376Z","updated_at":"2025-04-09T22:04:24.882Z","avatar_url":"https://github.com/sunxiuguo.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cdiv align=\"center\"\u003e\n    \u003cimg src=\"https://github.com/sunxiuguo/Koa-GraphQL-Template/blob/master/preview.jpeg\" width=\"100%\" alt=\"preview\"/\u003e\n\u003c/div\u003e\n\n# TypeScript and Koa GraphQL Server Template\n\nThis is a koa GraphQL template build with typescript\n\n## Include\n\n-   Koa2\n-   apollo-server-koa v2\n-   GraphQL(use type-graphql)\n-   mongodb (use mongoose + typegoose as orm)\n-   eslint\n-   nodemon\n-   prettier\n\n## Getting Started\n\n1. **install all dependencies**\n\n    `yarn`\n\n2. **install mongodb**\n\n    `brew tap mongodb/brew`\n\n    `brew install mongodb-community@4.2`\n\n3. **start mongo service**\n\n    `brew services start mongodb-community@4.2`\n\n4. **start server**\n\n    `yarn serve`\n\n5. **visit GraphQL**\n\n    `http://localhost:4000/graphql`\n\n    5.1 try to create a mutation\n\n    ```\n    mutation {\n        saveInfo(data: { hobby:[\"唱\",\"跳\",\"rap\",\"篮球\"], height:\"165\", weight: 100}){\n            hobby\n            height\n            weight\n        }\n    }\n    ```\n\n    then you will see\n\n    ![](https://user-gold-cdn.xitu.io/2020/3/26/171157c890f8e5e9?w=2860\u0026h=846\u0026f=png\u0026s=40442)\n\n    5.2 try to query\n\n    ```\n    query {\n        #   students(age:22){\n        #     sex\n        #     name\n        #     age\n        #   }\n\n        #   studentsWithInfo {\n        #     sex\n        #     name\n        #     age\n        #   }\n\n        infos {\n            _id\n            height\n            weight\n            hobby\n        }\n    }\n    ```\n\n    then you will see\n\n    ![](https://user-gold-cdn.xitu.io/2020/3/26/171157666f5e2c69?w=2872\u0026h=1478\u0026f=png\u0026s=86976)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsunxiuguo%2Fkoa-graphql-template","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsunxiuguo%2Fkoa-graphql-template","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsunxiuguo%2Fkoa-graphql-template/lists"}