{"id":22015352,"url":"https://github.com/ericz99/express-graphql-example","last_synced_at":"2026-04-12T05:36:03.621Z","repository":{"id":126122882,"uuid":"201156316","full_name":"ericz99/express-graphql-example","owner":"ericz99","description":"Real world example of using backend frameworks, and building a good API.","archived":false,"fork":false,"pushed_at":"2019-08-13T22:43:17.000Z","size":194,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-23T08:44:26.358Z","etag":null,"topics":["apollo-server","apollo-server-express","express","graphql","microservices","nodejs"],"latest_commit_sha":null,"homepage":"","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/ericz99.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,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-08-08T01:44:12.000Z","updated_at":"2023-03-26T06:46:17.000Z","dependencies_parsed_at":null,"dependency_job_id":"4268536a-23fc-4a21-b3ad-d839e033f05d","html_url":"https://github.com/ericz99/express-graphql-example","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/ericz99/express-graphql-example","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ericz99%2Fexpress-graphql-example","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ericz99%2Fexpress-graphql-example/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ericz99%2Fexpress-graphql-example/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ericz99%2Fexpress-graphql-example/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ericz99","download_url":"https://codeload.github.com/ericz99/express-graphql-example/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ericz99%2Fexpress-graphql-example/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31705574,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-12T05:11:36.334Z","status":"ssl_error","status_checked_at":"2026-04-12T05:11:27.332Z","response_time":58,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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-server","apollo-server-express","express","graphql","microservices","nodejs"],"created_at":"2024-11-30T04:21:26.818Z","updated_at":"2026-04-12T05:36:03.604Z","avatar_url":"https://github.com/ericz99.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Express-Graphql-Example (NOT FINISHED)\n\nSample real world example of using express + graphql, and how to interact with the api.\n\n## Motivation\n\nI seen a lot of good tutorial / guide on how to use these technology and it made me want to contribute to these tutorial / guide as well. So that is one of the reason why I decided to build a real world example on how to use these technology. I'm also hoping to spread my knowledge to others as well because I feel like doing this allows me, to learn more from my mistake and etc.\n\n## Table of contents\n\n\u003c!--ts--\u003e\n\n- [Installation](#installation)\n- [Configuration](#configuration)\n- [Usage](#usage)\n- [Examples](#example-of-queries-mutations--subscriptions)\n- [Features](#features)\n- [Built-with](#built-with)\n\n  \u003c!--te--\u003e\n\n### Installation\n\nExpress-Graphql-Example requires the following...\n\n- [Node.js (LTS Version)](http://nodejs.org/)\n- [YarnPKG](https://yarnpkg.com/lang/en/docs/install/#windows-stable)\n- [MongoDB](https://www.mongodb.com/download-center/community)\n\nQuick start:\n\n```bash\n\n# To install\ngit clone https://github.com/ericz99/express-graphql-example.git or download zip\n\n# Install dependencies\nyarn install\n\n# To start server\nyarn run dev\n\n# Server runs on http://localhost:8080/graphql\n\n```\n\n## Usage\n\n```bash\n\n# Graphql endpoint\nGraphql endpoint run on http://localhost:8080/graphql\n\n# See at below for example queries \u0026 mutation\nBefore you start querying, I have added role permission, so some queries or mutations requires an \"ADMIN\" permission level.\n\n```\n\n## Configuration\n\n```bash\n\n# Be sure to change .env.example -\u003e .env | MUST FILL ALL\n\nMONGO_URI=xxx\nPORT=8080\nSESS_SECRET=ssh!secret!\n\nREDIS_HOST=localhost\nREDIS_PORT=6379\nREDIS_PASSWORD=secret\n\nSECRET_KEY=1231221412\n\n```\n\n## Example of queries, mutations \u0026 subscriptions\n\n```\n\n# Query yourself\nquery {\n    me {\n        userID\n        email\n        key {\n            key\n            expiredIn\n        }\n    }\n}\n\n# Query other user\nquery {\n    getOneUser(userID: 1) {\n        userID\n        email\n    }\n}\n\n\n# Mutation create user\nmutation {\n    saveUser(email: 'test@gmail.com', password: 'testpwd') {\n        userID\n        email\n    }\n}\n\n# Keep track of realtime data with subscription\nsubscription {\n    keyGenerated {\n        key\n        expiredIn\n    }\n}\n\n```\n\n## Features\n\n- Authentication / Authorization\n- Subscription\n- Caching\n- Custom Directives\n- and more...\n\n## Todo\n\n- [x] Fix subscription handling\n- [ ] clean some server code\n- [ ] add membership section code\n- [ ] reduce code by putting in its owner middlewares\n- [ ] fix user \u0026 admin route from clashing between mutations\n- [ ] add access_token for admin\n- [ ] add caching for production ready\n- [ ] add few more custom directives for keys \u0026 memberships\n- [ ] implement monitoring \u0026 loggin metrics\n- [ ] add proper integration testing\n\n## Built With\n\n- [Node.js (LTS Version)](http://nodejs.org/) - Backend framework used\n- [Graphql](https://graphql.org/) - API Framework used\n- [ApolloGrahpql](https://www.apollographql.com/) - API Framework that works on top of graphql\n- [MongoDB](https://www.mongodb.com/download-center/community) - NOSQL Database used\n\n## Bugs?\n\nFeel free to make an issue about any particular errors.\n\n## App Info\n\n### Author\n\nEric Zhang\n\n### Version\n\n1.0.0\n\n### License\n\nThis project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fericz99%2Fexpress-graphql-example","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fericz99%2Fexpress-graphql-example","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fericz99%2Fexpress-graphql-example/lists"}