{"id":14975559,"url":"https://github.com/basemax/first-nodejs-apollo-mongodb-graphql","last_synced_at":"2025-10-27T14:30:34.274Z","repository":{"id":41189714,"uuid":"324033716","full_name":"BaseMax/first-nodejs-apollo-mongodb-graphql","owner":"BaseMax","description":"Good example for starter and learning GraphQL + Apollo Server + MongoDB + NodeJS easily and fastly. (based on Babel, Just in 10 minutes)","archived":false,"fork":false,"pushed_at":"2025-01-17T11:07:33.000Z","size":1784,"stargazers_count":7,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-02-04T07:15:37.934Z","etag":null,"topics":["apollo-graphql","apollo-server-express","graphql","graphql-api","graphql-client","graphql-example","graphql-examples","graphql-js","graphql-schema","graphql-server","mongodb","mongodb-database","mongodb-nodejs","mongoose","mongoose-model","mongoose-schema","mongoosejs","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-24T01:02:33.000Z","updated_at":"2025-01-17T11:07:27.000Z","dependencies_parsed_at":"2024-09-11T11:38:36.185Z","dependency_job_id":null,"html_url":"https://github.com/BaseMax/first-nodejs-apollo-mongodb-graphql","commit_stats":{"total_commits":49,"total_committers":2,"mean_commits":24.5,"dds":"0.30612244897959184","last_synced_commit":"5ba535b01c9cdceda7352066c40dd7dfec086875"},"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-apollo-mongodb-graphql","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BaseMax%2Ffirst-nodejs-apollo-mongodb-graphql/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BaseMax%2Ffirst-nodejs-apollo-mongodb-graphql/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BaseMax%2Ffirst-nodejs-apollo-mongodb-graphql/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/BaseMax","download_url":"https://codeload.github.com/BaseMax/first-nodejs-apollo-mongodb-graphql/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":238508469,"owners_count":19484135,"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-server-express","graphql","graphql-api","graphql-client","graphql-example","graphql-examples","graphql-js","graphql-schema","graphql-server","mongodb","mongodb-database","mongodb-nodejs","mongoose","mongoose-model","mongoose-schema","mongoosejs","node-js","nodejs"],"created_at":"2024-09-24T13:52:12.569Z","updated_at":"2025-10-27T14:30:28.957Z","avatar_url":"https://github.com/BaseMax.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# First NodeJS Apollo MongoDB GraphQL\n\nGood example for starter and learning GraphQL + Apollo Server + MongoDB + 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## Features\n\n- MongoDB\n- GraphQL\n- ExpressJS\n- Apollo Server\n- Babel JS\n\n## Using\n\n```\n$ yarn install\n$ yarn start\n```\n\nThen open `http://localhost:4000/graphql/`\n\n## Select all Cats\n\n```\n{\n  cats {\n     id\n     name\n  }\n}\n```\n\n![Mongodb - select all cats - Apollo GraphQL](screen1.png)\n\n## Insert a new Model, Cat\n\n```\nmutation {\n  createCat(name:\"Max\") {\n    id\n    name\n  }\n}\n```\n\n![mongodb - insert a new model cat - Apollo GraphQL](screen2.png)\n\n## Similar Repository\n\n- https://github.com/BaseMax/first-nodejs-graphql/\n\n### References\n\n- https://www.apollographql.com/docs/apollo-server/getting-started/\n- https://www.apollographql.com/docs/apollo-server/schema/schema/\n- https://github.com/apollographql/apollo-server\n- https://github.com/graphql/express-graphql\n- https://www.youtube.com/watch?v=YFkJGEefgU8\n\n#### Did you encounter a problem in Babel?\n\nThe following link may be helpful:\nhttps://stackoverflow.com/a/51530314/10096230\n\nChange `\"start\": \"nodemon --exec npm run babel-node index.js\"` to `\"start\": \"node ./node_modules/babel-cli/bin/babel-node.js --presets env index.js\",`\n\n\n### Installing Mongodb in Arch Linux\n\nYou can easily install MongoDB in Arch-base Linux by [following commands](https://stackoverflow.com/questions/59455725/install-mongodb-on-manjaro):\n\n```\npamac search -a mongodb-bin\npamac info -a mongodb-bin\n```\n\nAnd, then build and install with (this can be done after manually cloning too) -\n\n```\npamac build mongodb-bin\n```\n\n#### Did you encounter a problem in MongoDB?\n\nAs shown below, the service does not run and has an error.\nThis is a file access and execution error.\nThe easiest way is as follows:\n\n```\n[max@base first-nodejs-apollo-graphql]$ sudo systemctl status mongodb\n● mongodb.service - High-performance, schema-free document-oriented database\n     Loaded: loaded (/usr/lib/systemd/system/mongodb.service; enabled; vendor preset: disabled)\n     Active: failed (Result: exit-code) since Thu 2020-12-24 05:16:07 +0330; 4s ago\n```\n\nModify `/usr/lib/systemd/system/mongodb.service` file.\nHowever, manipulating these accesses is not recommended.\n\nAnyway, You can change user from `mongodb` to `root` to solve this problem:\n\n```\n[Unit]\nDescription=High-performance, schema-free document-oriented database\nAfter=network.target\n\n[Service]\nUser=root\nExecStart=/usr/bin/mongod --quiet --config /etc/mongodb.conf\n\n[Install]\nWantedBy=multi-user.target\n```\n\nAnd then:\n\n```\n$ systemctl daemon-reload\n\n$ sudo systemctl restart mongodb\n\n$ sudo systemctl status mongodb\n● mongodb.service - High-performance, schema-free document-oriented database\n     Loaded: loaded (/usr/lib/systemd/system/mongodb.service; enabled; vendor preset: disabled)\n     Active: active (running) since Thu 2020-12-24 05:16:39 +0330; 2s ago\n\n$ sudo systemctl enable mongodb\n```\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","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbasemax%2Ffirst-nodejs-apollo-mongodb-graphql","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbasemax%2Ffirst-nodejs-apollo-mongodb-graphql","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbasemax%2Ffirst-nodejs-apollo-mongodb-graphql/lists"}