mirror of
https://github.com/MichaelMure/git-bug.git
synced 2024-12-15 18:23:08 +03:00
20 lines
464 B
Go
20 lines
464 B
Go
//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))
|
|
}
|