#Gqlgen Issue
59 messages · Page 1 of 1 (latest)
you should be using gomodules with gqlgen
are you using go modules?
I have done all the steps, such as creating a module etc...
that's why it can parse the paths in gqlgen.yml in the first place.
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
Um, I dont understand this.
Push your problem onto github
are you asking you to tell you my gqlgen version?
Oh, create a issue?
Oh, gotcha.
BRB, lemme get on my desktop
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)
I have no issue with time honestly.
alright
GMT +?
Ah, I live in GMT + 5:30
Okay great
but thankfully, I am a night owl. So that works.
I will create a repo later, and put the link here.
great thanks
i am lazy to setup a gitignore
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
I have the #go:go run url generate - v thingy in resolver.go
and I will try that
I tried creating a file under graph/model and btw the directory graph/model already exists.
When I created the dummy file and ran the command, it said the same error and deleted the file I created
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