blob: 0069ce44172f1c7ae2d0ca9aedf3bc99ef056da1 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
|
//go:generate gorunpkg github.com/vektah/gqlgen
package graphql
import (
"github.com/MichaelMure/git-bug/graphql/graph"
"github.com/MichaelMure/git-bug/graphql/resolvers"
"github.com/MichaelMure/git-bug/repository"
"github.com/vektah/gqlgen/handler"
"net/http"
)
func NewHandler(repo repository.Repo) http.Handler {
backend := resolvers.NewBackend()
backend.RegisterDefaultRepository(repo)
return handler.GraphQL(graph.NewExecutableSchema(backend))
}
|