Graph icon indicating copy to clipboard operation
Graph copied to clipboard

Comparisons in .where cause crash

Open vlourme opened this issue 5 years ago • 0 comments

Hi 👋

I'm facing a weird issue, when I run this code:

// initial.id is a UUID

let search = Search<Entity>(graph: Globals.graph).where(
    .type("Customers", using: &&)
        && "id" == initial.id as CVarArg // <- Is it the good way?
)

This causes a crash (here is the crashlog: https://pastebin.com/uk6em3p1).

But if I run this code, it works:

let search = Search<Entity>(graph: Globals.graph).where(.type("Customers"))
let entity = search.sync().filter {
    $0["id"] as! UUID == initial.id
}

Am I doing something wrong with the new API or is it a library issue? Thanks!

vlourme avatar Jun 17 '20 09:06 vlourme