Skip to content

[Bug]: Property selection with renaming #516

@putt-t

Description

@putt-t

What happened?

all properties are being returned instead of what i renamed / remapped without me adding the ... in the RETURN

Steps to reproduce

rust sample code ingestion:

use helix_rs::{HelixDB, HelixDBClient};
use serde_json::json;

#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
    let client = HelixDB::new(Some("http://localhost"), Some(6969), None);

    let users = vec![
        ("Alice", 25, "[email protected]"),
        ("Bob", 30, "[email protected]"),
        ("Charlie", 28, "[email protected]"),
        ("Diana", 22, "[email protected]"),
    ];

    for (name, age, email) in &users {
        let _created: serde_json::Value = client.query("CreateUser", &json!({
            "name": name,
            "age": age,
            "email": email,
        })).await?;
    }

    let result: serde_json::Value = client.query("GetUserDisplayInfo", &json!({})).await?;
    println!("User display info: {result:#?}");

    Ok(())
}

queries

QUERY GetUserDisplayInfo () =>
    users <- N<User>::RANGE(0, 10)
    RETURN users::{displayName: name, userAge: age}

QUERY CreateUser (name: String, age: U8, email: String) =>
    user <- AddN<User>({
        name: name,
        age: age,
        email: email
    })
    RETURN user

schema

N::User {
    name: String,
    age: U8,
    email: String
}

Version

1.0.136

Environment

Development/Local

Relevant log output

Object {
            "age": Number(30),
            "displayName": String("Bob"),
            "email": String("[email protected]"),
            "name": String("Bob"),
            "userAge": Number(30),
        },

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions