Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
codegen/config: Add a new API to finish an already-validated config
LoadConfig parses the config from yaml, but it does a bunch of other things too. We want to parse the config ourselves, so that we can have extra fields which will be passed to our plugins. Right now, that means we either have to duplicate all of LoadConfig, or write the config back to disk only to ask gqlgen re-parse it. In this commit, I expose a new function that does all the parts of LoadConfig other than the actual YAML-reading: that way, a caller who wants to parse the YAML themselves (or otherwise programmatically compute the config) can do so without having to write it back to disk. An alternative would be to move all this logic to Config.Init(), but that could break existing clients. Either way would work for us.
- Loading branch information