Git Product home page Git Product logo

graphql-movie-quotes's Introduction

Slides

Please see my slidedeck for an overview of what GraphQL is, before going through the demo

https://slides.com/vincentntang/fullstack-graphql-nodejs-react#/

Component Architecture

  1. MovieList - A list of all movies are shown
  2. MovieCreate - Create movie form
  3. Movie - A detailed movie item

Branch structure

  • 01-frontend-only -> only has the frontend, starting point of demo
  • 02-frontend-backend-graphql -> same frontend, but finished standalone backend
  • 03-connected-frontend-backend -> same as master, fullstack integration

Quickstart

Globally install these dependencies anywhere

npm install -g nodemon

To install this repo, install the frontend and run

cd frontend
npm install
npm run start

In a seperate terminal, install backend and run

cd backend
npm install
npm run start

Sample Queries/Mutation

Once the backend is running, go to:

localhost:4000/graphql and try running these queries/mutations

Query a list of movies + their quotes

query {
  movies {
    movie_id
    title
    year
    plot
    poster
    quotes {
      quote_id
      description
    }
  }
}

Query a specific movie + their quotes

query Movie($movie_id: ID){
  movie(movie_id: $movie_id) {
    title
    year
    plot
    poster
    quotes {
      quote_id
      description
    }
  }
}

Query variables

{
  "movie_id": "tt0468569"
}

Mutation - Create a movie with a list of inputs

mutation CreateMovie($input: MovieInput!) {
  createMovie(input: $input) {
    movie_id
    title
    year
    plot
  }
}

Query Variables

{
  "input": {
    "title": "The Water Boy"
    "year": "1998"
    "plot": "Adam Sandler is no longer just a waterboy"
  }
}

graphql-movie-quotes's People

Contributors

vincentntang avatar

Stargazers

Roman avatar Crystal R Williams avatar Ryan Harrigan avatar

Watchers

James Cloos avatar  avatar  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.