Giter Site home page Giter Site logo

basemax / first-nodejs-graphql Goto Github PK

View Code? Open in Web Editor NEW
4.0 2.0 1.0 1.79 MB

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

License: MIT License

JavaScript 100.00%
graphql graphql-server graphql-api graphql-schema graphql-js graphql-nodejs nodejs graphql-example graphql-examples expressjs

first-nodejs-graphql's Introduction

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

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

Similar Repository

References


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

first-nodejs-graphql's People

Contributors

dependabot[bot] avatar suedarby avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

first-nodejs-graphql's Issues

Bug due to typo, can't create an author.

Hey there, super neat repo and a nice introduction to the topic of GraphQL. I was actually using this to introduce an intern to the concept. It's been very helpful to quickly put a presentation together. I did notice one small bug. Due to a typo, when adding an author, you're not actually getting the length from the authors array. Instead, you've got "author" which throws the error "Cannot access 'author' before initialization".

Here's the whole changelog to fix it:
image

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.