How can I use the Apollo Router with Rhai scripts on Docker?

Have more questions? Submit a request

If you want to use Rhai scripts on a Docker image, the Apollo Router configuration file) must contain a rhai key and a nested scripts or main key. The value for scripts declares the directory of .rhai files, which is ./rhai by default. This directory is where the Router loads the main.rhai file from. You can override the default main.rhai file with main.

# This is a top-level key. It MUST define at least one of the two
# sub-keys shown, even if you use that subkey's default value.
  # Specify a different Rhai script directory path with this key.
  # The path can be relative or absolute.
  scripts: "/dist/rhai/"

  # Specify a different name for your "main" Rhai file with this key.
  # The router looks for this filename in your Rhai script directory.
  main: "test.rhai"

You can review this repo on GitHub for a complete example. More info about implementing Rhai scripts with the Router can be found in our dev docs.

Articles in this section

Was this article helpful?
0 out of 0 found this helpful



Please sign in to leave a comment.