Skip to content

2nd-level error message, only showing non-matching properties #270

@karlhorky

Description

@karlhorky

Is your feature request related to a problem? Please describe.

When encountering a long SafeQL error, it's not easy to quickly and visually see the differences which are causing the mismatch:

Query has incorrect type annotation.
	Expected: { avatarPath: string; id: number; slug: string; tagline: string; focus: string; background: string; portfolioUrl: string; linkedinUrl: string; calendlyUrl: null | string; personalIntroThumbnailUrl: null | string; techAchievementsThumbnailUrl: null | string; personalIntroUrlPrivate: null | string; techAchievementsUrlPrivate: null | string; firstName: string; lastName: string; email: string; careerStatus: string; isPublishableByCurrentUser: boolean; personalIntroVimeoVideoId: null | number; techAchievementsVimeoVideoId: null | number; candidateLocations: unknown }[]
	  Actual: { firstName: string; lastName: string; id: number; slug: string; tagline: string; focus: string; background: string; portfolioUrl: string; linkedinUrl: string; avatarPath: string | null; calendlyUrl: string | null; personalIntroVimeoVideoId: number | null; personalIntroUrlPrivate: string | null; personalIntroThumbnailUrl: string | null; techAchievementsVimeoVideoId: number | null; techAchievementsUrlPrivate: string | null; techAchievementsThumbnailUrl: string | null; email: string; careerStatus: string; candidateLocations: unknown; isPublishableByCurrentUser: boolean }[]

Describe the solution you'd like

It would be great if there was a second-level error message (a refinement of the previous error message), which described which properties are a mismatch, including Expected and Actual types.

Describe alternatives you've considered

Only show the differences. While less visually "noisy", this may reduce utility for some users, who may want the full Expected and Actual types.

Additional context

Prior art can be seen in TypeScript error messages, which show multiple levels of error messaging, with each becoming more specific than the last:

image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions