CosmicMind / Graph

Graph is a semantic database that is used to create data-driven applications.
http://cosmicmind.com
MIT License
873 stars 72 forks source link

Comparisons in .where cause crash #166

Open vlourme opened 4 years ago

vlourme commented 4 years ago

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!