Coder Social home page Coder Social logo

tgmarinho / graphql-node-blog Goto Github PK

View Code? Open in Web Editor NEW
3.0 2.0 1.0 294 KB

Introdução ao GraphQL com NodeJS e MongoDB

Home Page: https://www.tgmarinho.com/introducao_ao_graphql_com_nodejs_e_mongodb/

JavaScript 100.00%
nodejs graphql graphql-server yoga-graphql mongodb mongoose

graphql-node-blog's Introduction

Thiago Marinho

API GraphQL com NodeJS, Server Yoga GraphQL + MongoDB e Mongoose

Este é um tutorial básico de implemetação de um servidor que expôe uma API em GraphQL para frontend fazer um CRUD de usuário.

Post no blog

https://www.tgmarinho.com/introducao_ao_graphql_com_nodejs_e_mongodb/

Configurar

  • Baixe o projeto:
1. git clone https://github.com/tgmarinho/graphql-node-blog.git
2. cd graphql-node-blog
  • Instala as dependências:
3. yarn
4. yarn start

ou

3. npm install
4. npm start

Abra a url http://localhost:4000/ e comece a brincar:

Queries and Mutations nammed.

query myNamedQuery {
  users {
    id
    name
    email
  }
}

mutation createNewUser {
  createUser(name: "Joao", email: "[email protected]") {
    name
    id
  }
}

Buscar um usuário com ID específico e retornar o seu nome:

{
  user(id: "5dc736d0fb540d5d3b5ca5d8") {
    name
  }
}


Retornar nome e email de todos os usuários

{
  users {
    name
    email
  }
}

Utilize o playground para fazer suas queries e mutations

Playground Screenshot

Author

Thiago Marinho
Thiago Marinho

Thanks!

graphql-node-blog's People

Contributors

tgmarinho avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

julianojcs

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.