/graphqlBasic99Design

simple basic getting started project in golang using 99 design gqlgen library for graphql

Primary LanguageGoApache License 2.0Apache-2.0

Graphql with Go

Using 99design Gqlgen library to have a schema and code generation. Followed offical getting started guide.

  • Playground working with query against Todos.
  • Create a new Todo using mutation.
  • Get realtime subscription that sends timestamps using websockets per second.

Subscription

Just follow simple subscription torial

Important graphql snippetes for playground

Query all todos

query findTodos {
todos {
    id
    text
    done
    user {
    id
    name
    }
    
}
}

Create a new TODO

mutation createTodo {
createTodo(input: { text: "haleem", userId: "1234293923423423" }) {
    user {
    id
    }
    text
    done
}
}

Subscription to time events

subscription realTime{
currentTime {
    unixTime
    timeStamp
}
}