git clone https://github.com/jemuelmiao/gqlgen.git
cd gqlgen
go build
进入待解析代码目录
[gqlgen.exe | gqlgen] generate
相比原版gqlgen,gqlgen.yml中需调整的配置项如下:
- resolver模块增加配置项:schema_dir,用于将schema文件夹根目录对应到resolver文件夹根目录
- resolver模块去掉resolver_template,内部使用三个template:resolver_interface.gotpl、resolver_schema.gotpl、resolver_single_file.gotpl
- resolver模块去掉package,根据schema中各目录名确定resolver中各包名
![image](https://private-user-images.githubusercontent.com/28854032/272454856-ad9adcfc-f900-46b5-865d-a6ebb43a497b.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjUzMTM0MDksIm5iZiI6MTcyNTMxMzEwOSwicGF0aCI6Ii8yODg1NDAzMi8yNzI0NTQ4NTYtYWQ5YWRjZmMtZjkwMC00NmI1LTg2NWQtYTZlYmI0M2E0OTdiLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA5MDIlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwOTAyVDIxMzgyOVomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTY1MjVlYThiYWU1NjQyNDNlZGU4Y2M4ZGM0ZDNhN2Y5MDY2ODU0ZDhhYmNmYWQ5OGVhY2IzZDY5NmQxMjk3MGYmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.MSo5KTEhl1s5-cZPhTAvPg5JjVJno0X2TxTbAJly0A8)