Giter Site home page Giter Site logo

bhargysh / graphql-playlist Goto Github PK

View Code? Open in Web Editor NEW

This project forked from iamshaunjp/graphql-playlist

0.0 1.0 0.0 820 KB

All course files for the GraphQL tutorial playlist on The Net Ninja YouTube channel.

JavaScript 74.53% HTML 13.51% CSS 11.96%

graphql-playlist's Introduction

graphql-playlist

To run the graphql server

cd server \
nodemon app

To run the react frontend

cd client \
nvm use 14.18.2 \
yarn start

Example GraphQL queries

Fetch all authors and their books

{
  authors{
    name,
    age
    books{
      name,
      id
    }
  }
}

Fetch all books and their authors

{
  books{
    name,
    genre,
    author {
      name,
      age
    }
  }
}

Fetch a book with id

{
  book(id: "61a820e00c2c6203fbdfa22c"){
    name
    genre
    author{
      name
      age
    }
  }
}

Add a book (not using frontend)

mutation{
  addBook(name: "Listen to me", genre: "Advice", authorId: "61a6ef2f1b0e122f29052fb8"){
    name
    genre
    author{
      id
    }
  }
}

graphql-playlist's People

Contributors

bhargysh avatar

Watchers

James Cloos avatar

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.