Giter Club home page Giter Club logo

44-graphql's Introduction

44-graphQL

dependencias

>npm i graphql express-graphql @graphql-tools/schema --save

Flujo

schema 🔽 resolver 🔽 controllers 🔽 services 🔽 productDao + model product

Interfaz gráfica

http://localhost:8080/graphql

query {
	getAllProducts {
	  _id
	  nombre
	  descripcion
    codigo
	  thumbnail
	  precio
	  stock
	}
}
mutation{
  addProduct(input:{
        nombre: "Iphone X 2",
        descripcion: "Pantalla de 6.5 pulgadas",
        codigo: "24567",
        thumbnail: "https://user-images.githubusercontent.com/63796774/175106135-03263dff-9b33-4b1c-9835-4e23c2e47ccf.jpeg",
        precio: 145000,
        stock: 23
  }){
    _id
    nombre
  }
}
mutation {
	deleteProduct(id:"63279be60d1d80898bce6398"){
    _id
    nombre
  }
}

mutation{
  updateProduct( id: "63279bdf0d1d80898bce6396", input:{
        nombre: "Iphone X upd",
        descripcion: "Pantalla de 6.5 pulgadas",
        codigo: "24567",
        thumbnail: "https://user-images.githubusercontent.com/63796774/175106135-03263dff-9b33-4b1c-9835-4e23c2e47ccf.jpeg",
        precio: 145000,
        stock: 23
  }){
    _id
    nombre
  }
}

Crear .env y completar variables:

  • MONGO_USER
  • MONGO_PASS
  • DB_NAME

44-graphql's People

Contributors

lauriacunia avatar

Watchers

 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.