Skip to content

Typescript typings does not match backend graphql #6478

@gcoutable

Description

@gcoutable

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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions