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
Variants can't be initialized via the constructor and their properties must be set after the object creation. Add the same possibility to initialize variants in the constructor the same way entities do.
Assuming input schema:
type MyEntity @entity {
myData: Int!
}
type MyEntityWithVariant @entity {
myVariantValue: MyVariant!
}
type MyVariant1 @variant {
myData: Int!
}
type MyVariant2 @variant {
myData: Int!
}
union MyVariant = MyVariant1 | MyVariant2
We can currently init entities like this:
const myEntity = new MyEntity({ myData: 1 })
but variants can't be initiated like that, and properties must be set afterward:
// const myVariant1 = new MyVariant1({ myData: 1 }) // this will fail: `Expected 0 arguments, but got 1`
const myVariant1 = new MyVariant1()
myVariant1.myData = 1
The text was updated successfully, but these errors were encountered:
Variants can't be initialized via the constructor and their properties must be set after the object creation. Add the same possibility to initialize variants in the constructor the same way entities do.
Assuming input schema:
We can currently init entities like this:
but variants can't be initiated like that, and properties must be set afterward:
The text was updated successfully, but these errors were encountered: