building a task managemnt system using graphql and with a very good test coverage for repository, usecase and graphql playground test.
- Golang
- Docker
- Postgres (included in docker)
- Migrations
- Graphql
- jwt
- testify
- mock
Setting up all containers
$ make postgress
Setting up all containers
$ make createdb
$ make dropdb
Migrating sql file into db
$ make migrationup
Dropping tables
$ make migrationdown
Note: Run migration when docker is running
Run all the test in the project with
$ make test
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"}
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")
}
mutation createLabel {
createLabel (
input: {
name: "label 1"
}
) {
Data{
id
name
created_at
updated_at
}
}
}
- 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