99designs / gqlgen

go generate based graphql server library
https://gqlgen.com
MIT License
9.92k stars 1.16k forks source link

Use embedded templates in root file generation #3168

Open barr-code opened 3 months ago

barr-code commented 3 months ago

What happened?

When a binary is shipped with gqlgen as one of its dependencies, with the follow-schema option set in the config, the following error is encountered:

open <your file structure path>/github.com/99designs/gqlgen@v0.17.42/codegen/root_.gotpl: no such file or directory

What did you expect?

The fix for issue 2260 offers the ability to pass in a TemplateFS option. However, that option is not being honored by the generateRootFile function. I would expect the same logic that was implemented here to apply in generateRootFile.

versions

clayne11 commented 2 months ago

That makes sense, feel free to PR.

barr-code commented 3 days ago

That makes sense, feel free to PR.

Thanks! I opened a PR to resolve this issue: https://github.com/99designs/gqlgen/pull/3319