You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If a project is created outside of the GOPATH and 'go mod init' is used, gqlgen should work.
Actual Behavior
gqlgen must be run from inside your $GOPATH
exit status 1
Steps to reproduce
aaaf94315952:~$ go version
go version go1.11.5 linux/amd64
aaaf94315952:~$ export GOPATH=
aaaf94315952:~$ mkdir -p ~/gqlgen-todos
aaaf94315952:~$ cd gqlgen-todos/
aaaf94315952:~/gqlgen-todos$ go mod init github.com/yourname/gqlgen-todos
go: creating new go.mod: module github.com/yourname/gqlgen-todos
aaaf94315952:~/gqlgen-todos$ mkdir scripts
aaaf94315952:~/gqlgen-todos$ cat > scripts/gqlgen.go << EOF
// +build ignore
package main
import "github.com/99designs/gqlgen/cmd"
func main() {
cmd.Execute()
}
EOF
aaaf94315952:~/gqlgen-todos$ cat > schema.graphql << EOF
type Todo {
id: ID!
text: String!
done: Boolean!
user: User!
}
type User {
id: ID!
name: String!
}
type Query {
todos: [Todo!]!
}
input NewTodo {
text: String!
userId: String!
}
type Mutation {
createTodo(input: NewTodo!): Todo!
}
EOF
aaaf94315952:~/gqlgen-todos$ go run scripts/gqlgen.go init
go: finding github.com/99designs/gqlgen/cmd latest
go: finding github.com/vektah/gqlparser/ast latest
go: finding github.com/vektah/gqlparser/gqlerror latest
go: finding github.com/vektah/gqlparser/validator latest
go: finding github.com/vektah/gqlparser/parser latest
go: finding golang.org/x/tools/go/loader latest
go: finding golang.org/x/tools/go/ast/astutil latest
go: finding golang.org/x/tools/imports latest
go: finding golang.org/x/tools/go/ast latest
go: finding golang.org/x/tools/go latest
go: finding golang.org/x/tools latest
NAME:
gqlgen - generate a graphql server based on schema
USAGE:
gqlgen [global options] command [command options] [arguments...]
DESCRIPTION:
This is a library for quickly creating strictly typed graphql servers in golang. See https://gqlgen.com/ for a getting started guide.
COMMANDS:
generate generate a graphql server based on schema
init create a new gqlgen project
version print the version string
help, h Shows a list of commands or help for one command
GLOBAL OPTIONS:
--verbose, -v show logs
--config value, -c value the config filename
--help, -h show help
gqlgen must be run from inside your $GOPATH
exit status 1
Pull Request Coming
I am working on a pull request that fixes this issue
The text was updated successfully, but these errors were encountered:
Expected Behaviour
If a project is created outside of the GOPATH and 'go mod init' is used, gqlgen should work.
Actual Behavior
Steps to reproduce
Pull Request Coming
I am working on a pull request that fixes this issue
The text was updated successfully, but these errors were encountered: