Skip to content

Estudo de API com NestJS e GraphQL - banco de dados MongoDB

Notifications You must be signed in to change notification settings

leolojacorr/chamados-nestjs-graphql

Repository files navigation

Nest Logo

A progressive Node.js framework for building efficient and scalable server-side applications.

NPM Version Package License NPM Downloads CircleCI Coverage Discord Backers on Open Collective Sponsors on Open Collective Support us

Description

Nest framework TypeScript starter repository.

Installation

$ npm install

Running the app

# development
$ npm run start

# watch mode
$ npm run start:dev

# production mode
$ npm run start:prod

Test

# unit tests
$ npm run test

# e2e tests
$ npm run test:e2e

# test coverage
$ npm run test:cov
  • Estrutura básica
  • CRUD

URL http://localhost:3000/graphql

Consulta

query {
	chamados {
    _id
    descricao
    status
    ticketKey
    data_criacao
    data_atualizacao
  }
} 

Insert

mutation {
  createChamado(createChamadoInput:{
    descricao: "teste3"
    ticketKey: "1234e"
    status: "ativo"

  }) {
    _id
    descricao
    data_criacao
    data_atualizacao
    status
  }
}

Update

mutation {
  updateChamado(updateChamadoInput:{
    _id: "6264a0537d5d986153dc564b"
,
    descricao: "update teste3 e"
    ticketKey: "update 1234e d"
    status: "inativo"
  }
  ) {
    _id
    descricao
    ticketKey
    data_criacao
    data_atualizacao
    status    
  }
}

https://docs.nestjs.com/techniques/mongodb

License

Nest is MIT licensed.

About

Estudo de API com NestJS e GraphQL - banco de dados MongoDB

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published