Use embedded templates in root file generation
- Linguagem predominante
- Go
- Estrelas
- 10.8k
- Forks
- 1.3k
- Merge médio
- 2d 36min
- PRs com merge (30d)
- 26
Descrição
### 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 /github.com/99designs/gqlgen@v0.17.42/codegen/root_.gotpl: no such file or directory`
### What did you expect?
[The fix](https://github.com/99designs/gqlgen/pull/2262) for [issue 2260](https://github.com/99designs/gqlgen/issues/2260) offers the ability to pass in a `TemplateFS` option. However, that option is not being honored by the [generateRootFile](https://github.com/99designs/gqlgen/blob/a13eca12117720d9d6cccba8549c7e6934d09fbd/codegen/generate.go#L139) function. I would expect the same logic that was implemented [here](https://github.com/99designs/gqlgen/blob/a13eca12117720d9d6cccba8549c7e6934d09fbd/codegen/templates/templates.go#L171) to apply in `generateRootFile`.
### versions
- `go run github.com/99designs/gqlgen version`?
v0.17.42
- `go version`?
go 1.22.4
Guia de contribuição
Avaliação
Esta issue ainda não foi avaliada.