Skip to content

task managemnet built using graphql with a good test coverage

Notifications You must be signed in to change notification settings

Emeka-Chukwu/go-task

Repository files navigation

go-task

Description

building a task managemnt system using graphql and with a very good test coverage for repository, usecase and graphql playground test.

Technical tools used

  • Golang
  • Docker
  • Postgres (included in docker)
  • Migrations
  • Graphql
  • jwt
  • testify
  • mock

Running

Setting up all containers

$ make postgress

Create and drop DB

Setting up all containers

$ make createdb

$ make dropdb

Migration

Migrating sql file into db

$ make migrationup

Dropping tables

$ make migrationdown

Note: Run migration when docker is running

Run Test

Run all the test in the project with

$ make test

Sections

  • Users

  • Task

  • Label

  • User:

mutation registerUser {
  createUser(
    input: {username: "emeka pas", email: "[email protected]", passwordHash: "Password@"}
  ) {
    token
    expired_at
    user {
      id
      username
      email
      passwordHash
      created_at
      updated_at
    }
  }
}

mutation loginUser {
  loginUser(input: {email: "[email protected]", password: "Password@"}) {
    token
    expired_at
    user {
      id
      username
      email
      passwordHash
      created_at
      updated_at
    }
  }
}

query getUserByID {
  getUserById(id: "a59ac614-96d9-4439-84dd-0ab2586ccd0a") {
    id
    username
    email
    created_at
    updated_at
  }
}

Header
{"Authorization":"bearer JWT_TOKEN_URL"}
  • Tasks

mutation createTask {
  createTask (
    input: {title:"title1", 
      description:"description", 
      priority:"high", 
      due_date:"2023-08-15 16:37:00.798196"}
  ) {
    Data{
      id
      title
      description
      due_date
      status
      priority
      user_id
      created_at
      updated_at
      
    }
  }
}


mutation updateTask {
  updateTask (
    input: {
      status:"in-progress"
      title:"title1", 
      id:"df51048f-6063-40f2-9ea2-5cf96f8bbfb5"
      description:"description", 
      priority:"high", 
      due_date:"2023-08-15 16:37:00.798196"}
  ) {
    Data{
      id
      title
      description
      due_date
      status
      priority
      user_id
      created_at
      updated_at
      
    }
  }
}

query getTaskById{
  getTaskById(id:"bab811c3-4ea6-4b74-b933-dfa760ab1be4"){
    Data{
       id
      title
      description
      due_date
      status
      priority
      user_id
      created_at
      updated_at
    }
  }
}

query fetchTasks{
  ListTask{
    Data{
       id
      title
      description
      due_date
      status
      priority
      user_id
      created_at
      updated_at
    }
  }
}

mutation deleteTaskById{
  deleteTask(id:"f6f2bc5f-3692-4d92-93a7-16a648180481")
}
  • Labels

mutation createLabel {
  createLabel (
    input: {
      name: "label 1"
    }
  ) {
    Data{
      id
     name
      created_at
      updated_at
      
    }
  }
}

Tasks

  • Users api implementaion
  • Users test coverage for the implemented graphql
  • Tasks implementation
  • Tasks test coverage for the implemented graphql
  • Label implementaion
  • write test for label graphql playground

About

task managemnet built using graphql with a good test coverage

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published