Missing __TypeSchema for node
- Dominant language
- Rust
- Stars
- 19k
- Forks
- 1.9k
- PR merge metrics
- No merged PRs in 30d
Description
We have a use case where we create a node on the client and add it to a Connection. The node type is a union of two types:
union ParentType = TypeA | TypeB
TypeA implements Node {}
TypeB implements Node {}
If we have fetched a node of either TypeA or TypeB, create a new one of the same type on the client, and add it to the store, it works fine.
However, if we don't yet have it fetched, creating and adding it to the store using 'insertEdgeAfter' in 'commitLocalUpdate' invalidates it.
We've observed that the __TypeScehma for TypeA and TypeB is missing.

'implentsInterface' identifier is undefined and marks data 'missing'.
As a workaround, If on app initialisation, we do something like:
```
store.create('client:type:TypeA', 'TypeSchema')
.setValue(true, 'isParentType')
.setValue(true, 'isNode');
store.create('client:type:TypeB', 'TypeSchema')
.setValue(true, 'isParentType')
.setValue(true, 'isNode');
```
things work fine, but this feels like a hack.
Contributor guide
Assessment
This issue has not been assessed yet.