英文:
Cannnot do "gqlgen generate"
问题
首先,我初始化了 gqlgen。
go run github.com/99designs/gqlgen init
其次,我修复了 resolver.go 和 schema.resolvers.go 文件。
然后,我执行了以下命令,但是出现了错误。
$ go run github.com/99designs/gqlgen generate
reloading module info
modelgen: unable to find type: github.com/99designs/gqlgen/interfaces.Int
exit status 1
你知道问题出在哪里吗?
我没有预料到会出现什么问题。
英文:
First, I initialized gqlgen.
go run github.com/99designs/gqlgen init
Second, I fixed resolver.go and schema.resolvers.go
And, I execute this. Then error has occurred.
$ go run github.com/99designs/gqlgen generate
reloading module info
modelgen: unable to find type: github.com/99designs/gqlgen/interfaces.Int
exit status 1
Do you know what is problem?
I did not expect what is problem.
答案1
得分: 1
我将这段代码添加到gqlgen.yml中,问题解决了。
models:
ID:
model:
- github.com/99designs/gqlgen/graphql.ID
- github.com/99designs/gqlgen/graphql.Int
- github.com/99designs/gqlgen/graphql.Int64
- github.com/99designs/gqlgen/graphql.Int32
Int:
model:
- github.com/99designs/gqlgen/graphql.Int
- github.com/99designs/gqlgen/graphql.Int64
- github.com/99designs/gqlgen/graphql.Int32
英文:
I add this to gqlgen.yml, problem is solved.
models:
ID:
model:
- github.com/99designs/gqlgen/graphql.ID
- github.com/99designs/gqlgen/graphql.Int
- github.com/99designs/gqlgen/graphql.Int64
- github.com/99designs/gqlgen/graphql.Int32
Int:
model:
- github.com/99designs/gqlgen/graphql.Int
- github.com/99designs/gqlgen/graphql.Int64
- github.com/99designs/gqlgen/graphql.Int32
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论