gqlgen not generating resolvers from custom model #2144
Unanswered
alexalexyang
asked this question in
Q&A
Replies: 1 comment
-
I ran into this today as well. The getting started docs are missing some updates. I created a pull request to update the docs to fix the issue. #2147 If you make these changes when following the tutorial every thing should work as expected. |
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
-
What happened?
I'm trying out the gqlgen getting-started tutorial and I'm stuck at the section "Don’t eagerly fetch the user", where we create a custom model and use
go run github.com/99designs/gqlgen generate
to generate new resolvers. But the resolvers were not generated.What did you expect?
It looks like this should be generated in graph/schema.resolvers.go:
What did you try?
I found this comment saying we should add to
resolver: true
for the model in gqlgen.yml.And also this issue for the same problem, which led me to its OP's repo where he solved the problem with a similar pattern.
So I tried different variations of both, one of them like this:
Minimal graphql.schema and models to reproduce
graph/model/todo.go
gqlgen.yml:
versions
Beta Was this translation helpful? Give feedback.
All reactions