Add support for accessing nested fields inside Future computed values
Closes #1261
This commit is contained in:
parent
426fce00a8
commit
4411b4d71f
1 changed files with 10 additions and 0 deletions
|
@ -27,6 +27,16 @@ impl Value {
|
|||
match path.first() {
|
||||
// Get the current path part
|
||||
Some(p) => match self {
|
||||
// Current path part is an object
|
||||
Value::Future(v) => {
|
||||
// Check how many path parts are remaining
|
||||
match path.len() {
|
||||
// No further embedded fields, so just return this
|
||||
0 => Ok(Value::Future(v.clone())),
|
||||
//
|
||||
_ => v.compute(ctx, opt, txn, None).await?.get(ctx, opt, txn, path).await,
|
||||
}
|
||||
}
|
||||
// Current path part is an object
|
||||
Value::Object(v) => match p {
|
||||
// If requesting an `id` field, check if it is a complex Record ID
|
||||
|
|
Loading…
Reference in a new issue