Skip to content

sekky0905/hello-graphQL-go

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

79 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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
  }
}

About

Simple sample of graphQL

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages