Calc fields on non persistable types

#1

How does a calc field work on non persistable types?

Ex:

type MyType {
 myField: string calc("concat(otherField, 'foo')")
 otherField: string = "abc"
}

MyType.make({}).myField is null

0 Likes

#2

make cannot trigger the evaluation of your calc field expression. This expression needs to be evaluation by the server (don’t which component though).

0 Likes

#3

This will only get calculated when that type is used in an entity type (either as the type for a field or via a mixin) and the “myField” is explicitly included in the include spec.

0 Likes