#Gqlgen Issue

59 messages · Page 1 of 1 (latest)

proud granite
#
validation failed: packages.Load: -: package goql/graph/model is not in GOROOT (/usr/lib/go/src/goql/graph/model)```
 
When `go generate ./...` is ran
hexed python
#

are you using go modules?

proud granite
#

ues

#

yes

#

it is on

proud granite
#

that's why it can parse the paths in gqlgen.yml in the first place.

hexed python
#

can you push your branch somewhere

#

or a version that reproduces the problem which i can push to

#

i have worked with gqlgen since alpha release

proud granite
hexed python
#

Push your problem onto github

proud granite
#

are you asking you to tell you my gqlgen version?

proud granite
hexed python
#

no

#

start a new repository

#

in that repo

#

push code that reproduces the problem

proud granite
#

Oh, gotcha.

hexed python
#

That's the fastest way i can help you

#

I think otherwise we might talk in circles

proud granite
#

BRB, lemme get on my desktop

hexed python
#

because your issue is with gomod and it could be on your own machine

#

fwiw i cant help until later this evening

#

but i will

#

(GMT)

proud granite
#

I have no issue with time honestly.

hexed python
#

alright

proud granite
hexed python
#

00

#

thats just my timezone

proud granite
#

Ah, I live in GMT + 5:30

hexed python
#

Okay great

proud granite
#

but thankfully, I am a night owl. So that works.

#

I will create a repo later, and put the link here.

hexed python
#

great thanks

proud granite
#

i am lazy to setup a gitignore

hexed python
#

okay so without me running this

#

your problem is your gqlgen.ymk

#

yml

#

if you tell it to generate in filename: graph/model/models_gen.go

#

the graph/model package and subdir has to exist

#

the package has to exist too

#

gqlgen just does this

#

so you can make a dummy pakcage with a 'something.go' file in it just to declare the package

#

generate ur shit

#

then remove the dummy file and then it'll forever work on its own

#

this doesnt apply to resolvers for some reason but generated models and server files yes

#

tldr fix where your gqlgen.yml points to and try again

#

also go generate ./... doesn't work out the box you have to actually define your gqlgen generate statement somewhere iirc adjacent to the gqlgen.yml

#

try all this

proud granite
#

and I will try that

proud granite
#

Github seemed to not include the folder as it was empty due to the lib deleting the models_gen.go file

#

Also if I highlight the model thingy, and run go generate ./... it says build constraints exclude all go files even if I have CGO_ENABLED variable set to 1
_
FIXED

#

Ok, I just created a extra schema Type and it fixed all issues. Except there is no schema.resolvers.go or server.go