package main
import (
"fmt"
"net/http"
graphql "github.com/graph-gophers/graphql-go"
"github.com/graph-gophers/graphql-go/relay"
"github.com/annibuliful-lab/graphqlws-subscriptiong/graphqlws"
)
const schema = `
schema {
subscription: Subscription
}
type Subscription {
...
}
`
type resolver struct {
// ...
}
func main() {
// init graphQL schema
s, err := graphql.ParseSchema(schema, &resolver{})
if err != nil {
panic(err)
}
// graphQL handler
graphQLHandler := graphqlws.NewHandlerFunc(s, &relay.Handler{Schema: s})
http.HandleFunc("/graphql", graphQLHandler)
// start HTTP server
if err := http.ListenAndServe(fmt.Sprintf(":%d", 8080), nil); err != nil {
panic(err)
}
}-
Couldn't load subscription status.
- Fork 0
License
Couldn't load subscription status.
annibuliful-lab/graphqlws-subscription
Folders and files
| Name | Name | Last commit message | Last commit date | |
|---|---|---|---|---|
Repository files navigation
About
No description, website, or topics provided.
Resources
License
Stars
Watchers
Forks
Packages 0
No packages published