Description
Many TypeScript types are currently incorrect, leading to runtime issues.
Most of the following property chains should not be possible:
viewer.editingContext.*
editingContext.representation.*
They stem from poorly defined TypeScript interfaces.
Specifically, the following declarations are incorrect and should be refactored:
editingContext: GQLEditingContext;
representation: GQL*; (* represents all inconsistent naming conventions)
Required Changes
It requires replacing the declarations above by:
editingContext: GQLEditingContext | null;
representation: GQLRepresentationMetadata | null;
It could be nice to also add a metadata check to prevent such declaration to happen again.
Description
Many TypeScript types are currently incorrect, leading to runtime issues.
Most of the following property chains should not be possible:
viewer.editingContext.*editingContext.representation.*They stem from poorly defined TypeScript interfaces.
Specifically, the following declarations are incorrect and should be refactored:
editingContext: GQLEditingContext;representation: GQL*;(*represents all inconsistent naming conventions)Required Changes
It requires replacing the declarations above by:
editingContext: GQLEditingContext | null;representation: GQLRepresentationMetadata | null;It could be nice to also add a metadata check to prevent such declaration to happen again.