Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix plugin template resolution (#2733)
- According to the documentation comment for [templates.Options], if the `Template` and `TemplateFS` fields are empty, it `Render` should find the `.gotpl` files from the calling plugin. However, it looks like this is broken since #2262 moved the resolution code to a separate helper function. This results in broken behavior in consumers such as [infiotinc/gqlgenc](https://github.com/infiotinc/gqlgenc) when they use the latest version of `gqlgen` as instead of finding the template from the plugin, the test template from this package is used which outputs only: `this is my test package`. - The cause for this is that `runtime.Caller` was still only skipping one stack level which means that it was finding the `Render` function instead of its caller. [templates.Options]: https://pkg.go.dev/github.com/99designs/gqlgen@v0.17.35/codegen/templates#Options
- Loading branch information