- Notifications
You must be signed in to change notification settings - Fork0
Good example for starter and learning GraphQL + Apollo Server + MongoDB + NodeJS easily and fastly. (based on Babel, Just in 10 minutes)
License
BaseMax/first-nodejs-apollo-mongodb-graphql
Folders and files
| Name | Name | Last commit message | Last commit date | |
|---|---|---|---|---|
Repository files navigation
Good example for starter and learning GraphQL + Apollo Server + MongoDB + NodeJS easily and fastly. (Just in 10 minutes)
If you would like to read more, you can check out official documentation athere.
- MongoDB
- GraphQL
- ExpressJS
- Apollo Server
- Babel JS
$ yarn install$ yarn startThen openhttp://localhost:4000/graphql/
{ cats { id name }}mutation { createCat(name:"Max") { id name }}- https://www.apollographql.com/docs/apollo-server/getting-started/
- https://www.apollographql.com/docs/apollo-server/schema/schema/
- https://github.com/apollographql/apollo-server
- https://github.com/graphql/express-graphql
- https://www.youtube.com/watch?v=YFkJGEefgU8
The following link may be helpful:https://stackoverflow.com/a/51530314/10096230
Change"start": "nodemon --exec npm run babel-node index.js" to"start": "node ./node_modules/babel-cli/bin/babel-node.js --presets env index.js",
You can easily install MongoDB in Arch-base Linux byfollowing commands:
pamac search -a mongodb-binpamac info -a mongodb-binAnd, then build and install with (this can be done after manually cloning too) -
pamac build mongodb-binAs shown below, the service does not run and has an error.This is a file access and execution error.The easiest way is as follows:
[max@base first-nodejs-apollo-graphql]$ sudo systemctl status mongodb● mongodb.service - High-performance, schema-free document-oriented database Loaded: loaded (/usr/lib/systemd/system/mongodb.service; enabled; vendor preset: disabled) Active: failed (Result: exit-code) since Thu 2020-12-24 05:16:07 +0330; 4s agoModify/usr/lib/systemd/system/mongodb.service file.However, manipulating these accesses is not recommended.
Anyway, You can change user frommongodb toroot to solve this problem:
[Unit]Description=High-performance, schema-free document-oriented databaseAfter=network.target[Service]User=rootExecStart=/usr/bin/mongod --quiet --config /etc/mongodb.conf[Install]WantedBy=multi-user.targetAnd then:
$ systemctl daemon-reload$ sudo systemctl restart mongodb$ sudo systemctl status mongodb● mongodb.service - High-performance, schema-free document-oriented database Loaded: loaded (/usr/lib/systemd/system/mongodb.service; enabled; vendor preset: disabled) Active: active (running) since Thu 2020-12-24 05:16:39 +0330; 2s ago$ sudo systemctl enable mongodbMy nickname is Max, Programming language developer, Full-stack programmer. I love computer scientists, researchers, and compilers. (Max Base)
A team includes some programmer, developer, designer, researcher(s) especially Max Base.
About
Good example for starter and learning GraphQL + Apollo Server + MongoDB + NodeJS easily and fastly. (based on Babel, Just in 10 minutes)
Topics
Resources
License
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Releases
Packages0
Uh oh!
There was an error while loading.Please reload this page.
Contributors2
Uh oh!
There was an error while loading.Please reload this page.

