I use gqlgen library in my Golang project to generate resolvers and models from GraphQl files. In my project, I use a mechanism to generate a query from models generated by gqlgen.
All things are true when that model doesn't have relational fields with himself(circle).
I'm looking for some way to don't generate those fields, In other words, I don't need that fields to be in the model. I need only its resolvers.
for example, this is my GraphQl file:
type Menu {
ID: Int!
SubMenu: Menu!
}
and this is the generated model:
type Menu struct {
ID int `json:"ID"`
SubMenu *Menu `json:"Product"`
}
I need only the resolvers for the SubMenu field. So my gqlgen.yml file is the same as:
models:
Menu:
fields:
SubMenu:
resolver: true
Is there any way to tell the gqlgen to skip some fields in generating models? Or do you have another solution to handle it?