aboutsummaryrefslogtreecommitdiffstats
path: root/graphql/gen_graphql.go
diff options
context:
space:
mode:
authorMichael Muré <batolettre@gmail.com>2018-12-23 17:11:37 +0100
committerMichael Muré <batolettre@gmail.com>2018-12-23 17:11:37 +0100
commit1410a1af75b1ab9ea3f980a7e372728f9a123abf (patch)
treee24db8f84c48b20158b1f1fd6d281d700421279c /graphql/gen_graphql.go
parent8fc15a032f021c855abf66ed303c003d57c340ea (diff)
downloadgit-bug-1410a1af75b1ab9ea3f980a7e372728f9a123abf.tar.gz
upgrade gqlgen to v0.7.1
Diffstat (limited to 'graphql/gen_graphql.go')
-rw-r--r--graphql/gen_graphql.go35
1 files changed, 2 insertions, 33 deletions
diff --git a/graphql/gen_graphql.go b/graphql/gen_graphql.go
index 84e0cfe0..41fa71a9 100644
--- a/graphql/gen_graphql.go
+++ b/graphql/gen_graphql.go
@@ -4,43 +4,12 @@ package main
import (
"fmt"
- "io/ioutil"
- "log"
- "os"
- "path"
- "github.com/99designs/gqlgen/codegen"
+ "github.com/99designs/gqlgen/cmd"
)
func main() {
- current, err := os.Getwd()
- if err != nil {
- log.Fatal(err.Error())
- }
-
- os.Chdir(path.Join(current, "graphql"))
-
fmt.Println("Generating graphql code ...")
- log.SetOutput(os.Stdout)
-
- config, err := codegen.LoadConfigFromDefaultLocations()
- if err != nil {
- log.Fatal(err)
- }
-
- schemaRaw, err := ioutil.ReadFile(config.SchemaFilename)
- if err != nil {
- log.Fatal("unable to open schema: " + err.Error())
- }
- config.SchemaStr = string(schemaRaw)
-
- if err = config.Check(); err != nil {
- log.Fatal("invalid config format: " + err.Error())
- }
-
- err = codegen.Generate(*config)
- if err != nil {
- log.Fatal(err.Error())
- }
+ cmd.Execute()
}