Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
karlhorky opened this issue Sep 21, 2024 · 0 comments
Open

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

karlhorky opened this issue Sep 21, 2024 · 0 comments

Comments

@karlhorky
Copy link
Collaborator

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant