aboutsummaryrefslogtreecommitdiffstats
path: root/graphql/gen_graphql.go
diff options
context:
space:
mode:
authorMichael Muré <batolettre@gmail.com>2020-06-21 22:12:04 +0200
committerMichael Muré <batolettre@gmail.com>2020-06-27 23:03:05 +0200
commit2ab6381a94d55fa22b80acdbb18849d6b24951f9 (patch)
tree99942b000955623ea7466b9fa4cc7dab37645df6 /graphql/gen_graphql.go
parent5f72b04ef8e84b1c367ca6874519706318e351f5 (diff)
downloadgit-bug-2ab6381a94d55fa22b80acdbb18849d6b24951f9.tar.gz
Reorganize the webUI and API code
Included in the changes: - create a new /api root package to hold all API code, migrate /graphql in there - git API handlers all use the cache instead of the repo directly - git API handlers are now tested - git API handlers now require a "repo" mux parameter - lots of untangling of API/handlers/middleware - less code in commands/webui.go
Diffstat (limited to 'graphql/gen_graphql.go')
-rw-r--r--graphql/gen_graphql.go33
1 files changed, 0 insertions, 33 deletions
diff --git a/graphql/gen_graphql.go b/graphql/gen_graphql.go
deleted file mode 100644
index 47f2c458..00000000
--- a/graphql/gen_graphql.go
+++ /dev/null
@@ -1,33 +0,0 @@
-// +build ignore
-
-package main
-
-import (
- "fmt"
- "io/ioutil"
- "log"
- "os"
-
- "github.com/99designs/gqlgen/api"
- "github.com/99designs/gqlgen/codegen/config"
- "github.com/pkg/errors"
-)
-
-func main() {
- fmt.Println("Generating graphql code ...")
-
- log.SetOutput(ioutil.Discard)
-
- cfg, err := config.LoadConfigFromDefaultLocations()
- if os.IsNotExist(errors.Cause(err)) {
- cfg = config.DefaultConfig()
- } else if err != nil {
- _, _ = fmt.Fprintln(os.Stderr, err.Error())
- os.Exit(2)
- }
-
- if err = api.Generate(cfg); err != nil {
- _, _ = fmt.Fprintln(os.Stderr, err.Error())
- os.Exit(3)
- }
-}