Skip to content

Commit

Permalink
Reintroduce main package in root
Browse files Browse the repository at this point in the history
  • Loading branch information
Mathew Byrne committed Feb 18, 2019
1 parent cdc575a commit 7692251
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 8 deletions.
2 changes: 1 addition & 1 deletion ambient.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package gqlgen
package main

import (
// Import and ignore the ambient imports listed below so dependency managers
Expand Down
2 changes: 1 addition & 1 deletion generate.go → api/generate.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package gqlgen
package api

import (
"syscall"
Expand Down
2 changes: 1 addition & 1 deletion option.go → api/option.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package gqlgen
package api

import (
"github.com/99designs/gqlgen/codegen/config"
Expand Down
4 changes: 2 additions & 2 deletions cmd/gen.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"fmt"
"os"

"github.com/99designs/gqlgen"
"github.com/99designs/gqlgen/api"
"github.com/99designs/gqlgen/codegen/config"
"github.com/pkg/errors"
"github.com/urfave/cli"
Expand Down Expand Up @@ -36,7 +36,7 @@ var genCmd = cli.Command{
}
}

if err = gqlgen.Generate(cfg); err != nil {
if err = api.Generate(cfg); err != nil {
fmt.Fprintln(os.Stderr, err.Error())
os.Exit(3)
}
Expand Down
5 changes: 2 additions & 3 deletions cmd/init.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,9 @@ import (
"os"
"strings"

"github.com/99designs/gqlgen/api"
"github.com/99designs/gqlgen/plugin/servergen"

"github.com/99designs/gqlgen"

"github.com/99designs/gqlgen/codegen/config"
"github.com/pkg/errors"
"github.com/urfave/cli"
Expand Down Expand Up @@ -73,7 +72,7 @@ var initCmd = cli.Command{
}

func GenerateGraphServer(cfg *config.Config, serverFilename string) {
err := gqlgen.Generate(cfg, gqlgen.AddPlugin(servergen.New(serverFilename)))
err := api.Generate(cfg, api.AddPlugin(servergen.New(serverFilename)))
if err != nil {
fmt.Fprintln(os.Stderr, err.Error())
}
Expand Down
9 changes: 9 additions & 0 deletions main.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
package main

import (
"github.com/99designs/gqlgen/cmd"
)

func main() {
cmd.Execute()
}

0 comments on commit 7692251

Please sign in to comment.