gqlgen-todos

module
v0.0.0-...-b7e616d Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 5, 2022 License: MIT

README

Golang with GraphQL

Requirements

  • Docker

Run

$ docker compose up

Generate

$ docker compose exec server go generate ./...

Example

Find todos
query findTodos {
  todos {
    id
    text
    done
    user {
      id
    }
  }
}
Create todo
mutation createTodo {
  createTodo(input: { text: "todo1234", userId: "54321" }) {
    id
    user {
      id
    }
    text
    done
  }
}
Update todo
mutation updateTodo {
  updateTodo(
    input: {
      id: "af1310c4-0a86-47e6-8429-31bfeb7bda86"
      text: "todo123456"
      userId: "98765"
      done: false
    }
  ) {
    id
    text
    done
  }
}
Delete todo
mutation deleteTodo {
  deleteTodo(input: { id: "af1310c4-0a86-47e6-8429-31bfeb7bda86" })
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL