{"id":14976085,"url":"https://github.com/basemax/first-nodejs-graphql","last_synced_at":"2026-04-02T18:45:08.140Z","repository":{"id":151535326,"uuid":"324030254","full_name":"BaseMax/first-nodejs-graphql","owner":"BaseMax","description":"Good example for starter and learning GraphQL + NodeJS easily and fastly. (Just in 10 minutes)","archived":false,"fork":false,"pushed_at":"2025-01-17T11:07:18.000Z","size":2026,"stargazers_count":6,"open_issues_count":1,"forks_count":2,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-02-04T07:15:40.435Z","etag":null,"topics":["express","express-js","expressjs","expressjs-server","graphql","graphql-api","graphql-example","graphql-examples","graphql-js","graphql-nodejs","graphql-schema","graphql-server","js","node-js","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/BaseMax.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":"2020-12-24T00:35:33.000Z","updated_at":"2025-01-17T11:07:13.000Z","dependencies_parsed_at":null,"dependency_job_id":"9031d8b7-1a1c-42fc-a506-424edae3a239","html_url":"https://github.com/BaseMax/first-nodejs-graphql","commit_stats":{"total_commits":37,"total_committers":4,"mean_commits":9.25,"dds":0.2702702702702703,"last_synced_commit":"d923077b9788ad58cbb26c8e3af5ed95ca08f038"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BaseMax%2Ffirst-nodejs-graphql","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BaseMax%2Ffirst-nodejs-graphql/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BaseMax%2Ffirst-nodejs-graphql/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BaseMax%2Ffirst-nodejs-graphql/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/BaseMax","download_url":"https://codeload.github.com/BaseMax/first-nodejs-graphql/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":238527261,"owners_count":19487188,"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":["express","express-js","expressjs","expressjs-server","graphql","graphql-api","graphql-example","graphql-examples","graphql-js","graphql-nodejs","graphql-schema","graphql-server","js","node-js","nodejs"],"created_at":"2024-09-24T13:53:16.813Z","updated_at":"2025-10-27T17:30:37.746Z","avatar_url":"https://github.com/BaseMax.png","language":"JavaScript","readme":"# First NodeJS GraphQL\n\nGood example for starter and learning GraphQL + NodeJS easily and fastly. (Just in 10 minutes)\n\nIf you would like to read more, you can check out official documentation at [here](https://graphql.org/graphql-js/running-an-express-graphql-server/).\n\n## Using\n\n```\n$ yarn install\n$ yarn start\n```\n\n- Download MongoDB Compass and install from [here](https://www.mongodb.com/try/download/compass).\n\n Once MongoDB Compass is installed, you can open it to view your host and port details.\n\n- Make sure to update your database configuration in `config/.env` to match your MongoDB setup.\n\n## images of MongoCompass\n\n- Below are some images showcasing MongoDB Compass to help you get familiar with the interface.\n\n![first nodejs graphql](images/cap7.PNG)\n\n![first nodejs graphql](images/cap8.PNG)\n\n![first nodejs graphql](images/cap10.PNG)\n\n\n\nThen open: `http://localhost:5000/graphql/?query=%7B%0A%20%20books%20%7B%0A%20%20%20%20id%2C%0A%20%20%20%20name%0A%20%20%7D%0A%0A%7D`\n\n## Examples\n\n#### List of all books id and name\n```\n{\n  books {\n    id,\n    name\n  }\n}\n```\n\n![first nodejs graphql](images/screen1.png)\n\n#### List of authors and their books\n\n```\n{\n  authors {\n    id\n    name\n    books {\n      name\n    }\n  }\n}\n```\n\n![first nodejs graphql](images/screen2.png)\n\n\n#### List of authors name\n\n```\n{\n  authors {\n    name\n  }\n}\n```\n\n![first nodejs graphql](images/cap6.PNG)\n\n\n\n#### List of books id\n\n```graphql\n{\n  books {\n    id\n  }\n}\n```\n\n![first nodejs graphql](images/cap5.PNG)\n\n\n\n#### Get a Single Book by args(Id)\n\n```graphql\n{\n  book(id:\"66fdc7ab769dea390bb26fc8\") {\n    name\n  }\n}\n```\n\n![first nodejs graphql](images/cap4.PNG)\n\n\n#### Add book by name and authorId\n\n```graphql\n{\n  mutation{\n    addBook(name:\"sincefiction\",authorId:\"66fdc6e7769dea390bb26fc4\"){\n    id,\n    name\n    }\n  }\n}\n```\n\n![first nodejs graphql](images/cap3.PNG)\n\n\n#### Add author by name\n\n```graphql\n{\n  mutation{\n    addAuthor(name:\"max\"){\n    id,\n    name\n    }\n  }\n}\n```\n\n![first nodejs graphql](images/cap2.PNG)\n\n\n## Similar Repository\n\n- https://github.com/BaseMax/first-nodejs-apollo-graphql/\n\n### References\n\n- https://graphql.org/graphql-js/running-an-express-graphql-server\n- https://github.com/graphql/express-graphql\n- https://www.youtube.com/watch?v=n1mdAPFq2Os\n- https://www.youtube.com/watch?v=YBydg_Ui02Q\n- https://www.youtube.com/watch?v=ZQL7tL2S0oQ\n\n---------\n\n# Max Base\n\nMy nickname is Max, Programming language developer, Full-stack programmer. I love computer scientists, researchers, and compilers. ([Max Base](https://maxbase.org/))\n\n## Asrez Team\n\nA team includes some programmer, developer, designer, researcher(s) especially Max Base.\n\n[Asrez Team](https://www.asrez.com/)\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbasemax%2Ffirst-nodejs-graphql","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbasemax%2Ffirst-nodejs-graphql","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbasemax%2Ffirst-nodejs-graphql/lists"}