Skip to content

amowogbaje/task-crud-api

Repository files navigation

task-crud-api

This is a simple crud app for task management

Installation

$ npm install

Running the app

# development
$ npm run start


# production mode
$ npm run start:prod

Test

# unit tests
$ npm run test


Setting up

Download Mongo Compass on your localhost or connect remotely

Please refer to the MongoDB documentation for comprehensive usage and reference: Click here. Make sure to do your configuration in src/app.module.ts

After setting up go to:

http://127.0.0.1:3000/graphql

Interacting with the GraphQl Interface

Query Commands

Query all

query {
  tasks {
    _id
    title
    description
  }
}

Query with id

query {
  task(_id: "your-task-id") {
    _id
    title
    description
  }
}

create Mutation

mutation {
  createTask(createTaskInput: {title: "GOod morning", description: "A little chores"}) {
    _id
    title
    description
  }
}

Update mutation with id

mutation {
  updateTask(updateTaskInput: {
    _id: "your-task-id",
    title: "Updated Title",
    description: "Updated Description",
  }) {
    _id
    title
    description
  }
}

Delete mutation with id

mutation {
  removeTask(_id: "your-task-id") {
    _id
    title
    description
  }
}

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published