apollographql / router

A configurable, high-performance routing runtime for Apollo Federation 🚀
https://www.apollographql.com/docs/router/
Other
807 stars 272 forks source link

rhai should have access to the yaml configuration file #2070

Open Geal opened 1 year ago

Geal commented 1 year ago

while it is easy to hardcode the configuration in the rhaiscript file and reload, it would be way easier to use if we could separate the code part and the configuration part even for rhai plugins.

chandrikas commented 1 year ago

@Geal , could you please elaborate? When would we need this? What kind of configuration do we want to provide?

Geal commented 1 year ago

when writing a rhai script for the router, we cannot add configuration options. If we want to change its behaviour (feature flags, etc), we need to change it in the script and reload the script. I am proposing that we add a section to the rhai plugin configuration where options could be passed to scripts