Stored calc field referencing fkey field not returning on extending type

#1

I have the following types:

extendable entity type TypeA schema name "TYPA" {
  field1: string
  fkeyResults: [TypeC] (field1,field2)
  storedCalcField: [string] stored calc "unique(fkeyResults.someField.someField)" schema suffix "SCF"
}

entity type TypeB extends Type A type key "TYPB" {
  hasOtherFields: string
}

fkeyResults populates for TypeA and TypeB, but storedCalcField is empty on TypeB, even with refreshCalcFields set in the fetch
If I TypeB.eval({projection: “unique(fkeyResults.someField.someField)”}), I get results as well

Is this a bug? Or is the way I’m storing this calc field producing expected results?

#2

it is normal that fkeyResults is populated for TypeB if your TypeC reference values for field1 that exists for objects with TypeB.
Can you try with just calc field, e.g.

calcField: [string] calc "unique(fkeyResults.someField.someField)"

I think the problem is due to the schema suffix in your stored calc field, not sure if it;'s required or not for arrays but can you try removing it for your field, e.g.

storedCalcField: [string] stored calc "unique(fkeyResults.someField.someField)"
#3

Might be a typo in just this post, but I think this should be schema name instead of schema suffix

#4

Yep, typo (edited in post)

#5

@bachr a regular calc field returns correctly, so i think it has to do with how it’s stored
and schema suffix is required for a stored array field

#6

@sean.summers This will require more investigation. Please file a ticket. I do have tests that approximate that but maybe there is a hole somewhere. Can you please include all relevant types (e.g. TypeC and whatever type fkeyResults.someField.someField is in.

#7

Will do. Thanks @trothwein