GQL Gen import error and MongoDB compatibility #2726
Unanswered
matiascshaha
asked this question in
Q&A
Replies: 2 comments 1 reply
-
any update on this issue please |
Beta Was this translation helpful? Give feedback.
1 reply
-
for anyone wondering I found solution to bson issue #865 (comment) |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello team,
I have 2 issues. I am trying to run my generate command "go run github.com/99designs/gqlgen generate", but I am getting:
missing go.sum entry for module providing package github.com/urfave/cli/v2 (imported by github.com/99designs/gqlgen); to add: go get github.com/99designs/[email protected] C:\Users\matia\go\pkg\mod\github.com\99designs\[email protected]\internal\imports\prune.go:15:2: missing go.sum entry for module providing package golang.org/x/tools/go/ast/astutil (imported by github.com/99designs/gqlgen/internal/imports); to add: go get github.com/99designs/gqlgen/internal/[email protected] C:\Users\matia\go\pkg\mod\github.com\99designs\[email protected]\internal\code\packages.go:14:2: missing go.sum entry for module providing package golang.org/x/tools/go/packages (imported by github.com/99designs/gqlgen/codegen/config); to add: go get github.com/99designs/gqlgen/codegen/[email protected] C:\Users\matia\go\pkg\mod\github.com\99designs\[email protected]\internal\imports\prune.go:16:2: missing go.sum entry for module providing package golang.org/x/tools/imports (imported by github.com/99designs/gqlgen/internal/imports); to add: go get github.com/99designs/gqlgen/internal/[email protected]
when I run the get commands to install the dependencies, then the generate command works, but everytime I want to generate models after that, I get the same error. I have tried adding //go:generate go run github.com/99designs/gqlgen
//go:generate go get github.com/99designs/gqlgen/[email protected] to my resolver file as advised by #1483 and that does not work. running go run -mod=mod github.com/99designs/gqlgen generate fixes the issue, but I was hoping there was a more robust fix because the -mod flag makes the command install dependencies every time I run it.
My second issue is concerning GQL gens compatibility with mongo db. I am trying to insert documents into mongo DB by passing a unique ID, but the problem is that the GQL Gen models don't have BSON marshelling, so It doesn't read my model correctly, when I try inserting. and when I try reading the documents it does not work either.
is there a fix for this in the library?
Beta Was this translation helpful? Give feedback.
All reactions