GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - BaseMax/first-nodejs-graphql: Good example for starter and learning GraphQL + NodeJS easily and fastly. (Just in 10 minutes)

BranchesTags
Open more actions menu

Latest commit

 

History

75 Commits
75 Commits

Folders and files

NameName
Last commit message
Last commit date
config
config
 
 
images
images
 
 
models
models
 
 
node_modules
node_modules
 
 
.gitignore
.gitignore
 
 
LICENSE
LICENSE
 
 
README.md
README.md
 
 
index.js
index.js
 
 
notes.txt
notes.txt
 
 
package-lock.json
package-lock.json
 
 
package.json
package.json
 
 
screen1.png
screen1.png
 
 
screen2.png
screen2.png
 
 
yarn.lock
yarn.lock
 
 

Repository files navigation

First NodeJS GraphQL

Good example for starter and learning GraphQL + NodeJS easily and fastly. (Just in 10 minutes)

If you would like to read more, you can check out official documentation at here.

Using

$ yarn install
$ yarn start
  • Download MongoDB Compass and install from here.

Once MongoDB Compass is installed, you can open it to view your host and port details.

  • Make sure to update your database configuration in config/.env to match your MongoDB setup.

images of MongoCompass

  • Below are some images showcasing MongoDB Compass to help you get familiar with the interface.

first nodejs graphql

first nodejs graphql

first nodejs graphql

Then 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

Examples

List of all books id and name

{
  books {
    id,
    name
  }
}

first nodejs graphql

List of authors and their books

{
  authors {
    id
    name
    books {
      name
    }
  }
}

first nodejs graphql

List of authors name

{
  authors {
    name
  }
}

first nodejs graphql

List of books id

{
  books {
    id
  }
}

first nodejs graphql

Get a Single Book by args(Id)

{
  book(id:"66fdc7ab769dea390bb26fc8") {
    name
  }
}

first nodejs graphql

Add book by name and authorId

{
  mutation{
    addBook(name:"sincefiction",authorId:"66fdc6e7769dea390bb26fc4"){
    id,
    name
    }
  }
}

first nodejs graphql

Add author by name

{
  mutation{
    addAuthor(name:"max"){
    id,
    name
    }
  }
}

first nodejs graphql

Similar Repository

  • https://github.com/BaseMax/first-nodejs-apollo-graphql/

References

  • https://graphql.org/graphql-js/running-an-express-graphql-server
  • https://github.com/graphql/express-graphql
  • https://www.youtube.com/watch?v=n1mdAPFq2Os
  • https://www.youtube.com/watch?v=YBydg_Ui02Q
  • https://www.youtube.com/watch?v=ZQL7tL2S0oQ

Max Base

My nickname is Max, Programming language developer, Full-stack programmer. I love computer scientists, researchers, and compilers. (Max Base)

Asrez Team

A team includes some programmer, developer, designer, researcher(s) especially Max Base.

Asrez Team

About

Good example for starter and learning GraphQL + NodeJS easily and fastly. (Just in 10 minutes)

Topics

expressexpress-jsexpressjsexpressjs-servergraphqlgraphql-apigraphql-examplegraphql-examplesgraphql-jsgraphql-nodejsgraphql-schemagraphql-serverjsnode-jsnodejs

Resources

Readme
MIT license
Activity

Stars

7 stars

Watchers

1 watching

Forks

1 fork
Report repository

Releases

Packages

Used by

Contributors

Languages

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.