You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm trying to extend the Dgraph 101 example with AssemblyScript to my own nested classes and types, but I run into errors when trying to upsert them. Plain, unnested classes seem to work fine.
I'm sure there's an easy fix for this, but not able to find it, see attached files.
So, a bit further down the rabbit hole... I cannot get the graph relations the way they should be. AssemblyScript is complaining about circular references EnergyProfile/PumpingStation - I get that - but now I end up with these classes, they work, but I lose the typical Graph features now:
export class EnergyProfile {
@alias("EnergyProfile.id")
id!: string
@alias("EnergyProfile.pumpingstation_id") // Note the _id suffix
@omitnull()
pumpingstation_id: string | null = null // Actually store the ID as string
@alias("EnergyProfile.name")
name: string = ""
@alias("EnergyProfile.day")
day: i16 = 1
@alias("EnergyProfile.month")
month: i16 = 1
@alias("EnergyProfile.price")
price: f32[] = [1.0]
}
@json
export class PumpingStation {
@alias("PumpingStation.id")
id!: string
@alias("PumpingStation.name")
name: string = ""
@alias("PumpingStation.flow_rate")
flow_rate: f32 = 0.0
@alias("PumpingStation.energyprofile_ids") // Note the _ids suffix
@omitnull()
energyprofile_ids: string[] | null = null // Actually store IDs as strings
@alias("PumpingStation.place")
place: string = ""
}
I'm trying to extend the
Dgraph 101
example with AssemblyScript to my own nested classes and types, but I run into errors when trying toupsert
them. Plain, unnested classes seem to work fine.I'm sure there's an easy fix for this, but not able to find it, see attached files.
as.zip
The text was updated successfully, but these errors were encountered: