Gqlgen: Getting started init : 'resolvergen: -: package go_graphql/graph is not in GOROOT'

Created on 15 Aug 2020  路  8Comments  路  Source: 99designs/gqlgen

What happened?

  • I followed the getting started steps to make my first graphql project, but when i run 'go run github.com/99designs/gqlgen init' it outputs 'resolvergen: -: package go_graphql/graph is not in GOROOT'. I successfully created a project but the project is missing the resolver.go, schema.resolvers.go, and the server.go

What did you expect?

I expected to get a graphql project with all the components including resolver.go, schema.resolvers.go, and the server.go

versions

  • I use gqlgen version 0.12.1 => just tried it this morning
  • I use go version of 1.14.6
  • Im quite new and i dont really understand the go modules yet but this is what mine looks like
    image

Most helpful comment

Try this, it worked for me now:
try using this combination. Update it in go.mod file and run "go mod tidy"
github.com/99designs/gqlgen v0.11.3
github.com/vektah/gqlparser/v2 v2.0.1

But it took my 3-4 hours to resolve this.

All 8 comments

if i run it inside my GOROOT folder it shows this response
image

Try this, it worked for me now:
try using this combination. Update it in go.mod file and run "go mod tidy"
github.com/99designs/gqlgen v0.11.3
github.com/vektah/gqlparser/v2 v2.0.1

But it took my 3-4 hours to resolve this.

Try this, it worked for me now:
try using this combination. Update it in go.mod file and run "go mod tidy"
github.com/99designs/gqlgen v0.11.3
github.com/vektah/gqlparser/v2 v2.0.1

But it took my 3-4 hours to resolve this.

Thanks, solved it for me, much appreciate it man

but can you do 'gqlgen generate' because for me, i cant seem to generate gqlgen commands

here is my terminal
image

I had this problem too. I appreciate your quick solution. Just wanted to try out gqlgen quickly. Generate seems to be working for me, unlike what you just brought up.

goto graph -> cd graph
go run github.com/99designs/gqlgen generate

This is working for me

go run github.com/99designs/gqlgen generate

apparently this doesn't work for me, i can check my version but i still can't generate, it returns nothing
image

if i execute 'go run gqlgen generate' it show output like this
image

go run github.com/99designs/gqlgen generate

apparently this doesn't work for me, i can check my version but i still can't generate, it returns nothing
image

if i execute 'go run gqlgen generate' it show output like this
image

an update, mine worked now, I try deleting the schema.resolvers.go and then run "go run github.com/99designs/gqlgen generate" without the "". After the new schema.resolvers.go is built i can use generate by running the previous command

Was this page helpful?
0 / 5 - 0 ratings

Related issues

bjm88 picture bjm88  路  4Comments

sumanthakannantha picture sumanthakannantha  路  3Comments

theoks picture theoks  路  3Comments

RobertoOrtis picture RobertoOrtis  路  3Comments

jacksontj picture jacksontj  路  4Comments