Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions NEXT_CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,12 @@ By [@USERNAME](https://github.com/USERNAME) in https://github.com/apollographql/
## ❗ BREAKING ❗
## 🚀 Features
## 🐛 Fixes

### Fix the rhai SDL print function [Issue #2005](https://github.com/apollographql/router/issues/2005))

A recent change to the way we provide the SDL to plugins broke the rhai SDL print. This fixes it.

By [@fernando-apollo](https://github.com/fernando-apollo) in https://github.com/apollographql/router/pull/2007
## 🛠 Maintenance

### Split the configuration file management in multiple modules [Issue #1790](https://github.com/apollographql/router/issues/1790))
Expand Down
4 changes: 2 additions & 2 deletions apollo-router/src/plugins/rhai.rs
Original file line number Diff line number Diff line change
Expand Up @@ -390,7 +390,7 @@ impl Plugin for Rhai {
let engine = Arc::new(Rhai::new_rhai_engine(Some(scripts_path)));
let ast = engine.compile_file(main)?;
let mut scope = Scope::new();
scope.push_constant("apollo_sdl", sdl);
scope.push_constant("apollo_sdl", sdl.to_string());
scope.push_constant("apollo_start", Instant::now());

// Run the AST with our scope to put any global variables
Expand Down Expand Up @@ -1589,7 +1589,7 @@ mod tests {
let mut guard = scope.lock().unwrap();

// Call our function to make sure we can access the sdl
let sdl: Arc<String> = rhai_instance
let sdl: String = rhai_instance
.engine
.call_fn(&mut guard, &rhai_instance.ast, "get_sdl", ())
.expect("can get sdl");
Expand Down