Skip to content

Latest commit

 

History

History
66 lines (55 loc) · 868 Bytes

README.md

File metadata and controls

66 lines (55 loc) · 868 Bytes

hello-graphQL-go

Simple sample of graphQL

How to run

$ go run ./server/server.go
$ open http://localhost:8080/

Query Sample

mutation createUser {
  createUser(input: { name: "name" }) {
    id
    name
  }
}

mutation createChatRoom {
  createChatRoom(input: { userID: "user_{uuid for user_id}", title: "title" }) {
    id
    title
    createdBy {
      id
      name
    }
  }
}

mutation createComment {
  createComment(input: { content: "content", chatRoomID: "chat_room_{uuid for chat_room}", userID: "user_{uuid for user_id}" }) {
    id
    content
    postedBy {
      id
      name
    }
    createdAt
  }
}


query GetUsers {
  users {
    id
    name
  }
}

query GetChatRooms {
  chatRooms {
    id
    title
  }
}

query GetComments {
  commentsByUser(userID: "user_{uuid for user_id}") {
    id
    content
  }
}