fix(dashboard): show internal error in toast message (#2496)

This commit is contained in:
Hassan Ben Jobrane
2024-01-26 17:42:18 +01:00
committed by GitHub
parent d5337ff5bd
commit ba73bb4003
2 changed files with 15 additions and 1 deletions

View File

@@ -0,0 +1,5 @@
---
'@nhost/dashboard': patch
---
fix: update ErrorToast component to show the internal graphql error

View File

@@ -46,7 +46,16 @@ export default function ErrorToast({
error,
};
const msg = error?.graphQLErrors?.at(0)?.message || errorMessage;
const internalError = error?.graphQLErrors?.at(0)?.extensions?.internal as {
error: {
message: string;
};
};
const msg =
internalError?.error?.message ||
error?.graphQLErrors?.at(0).message ||
errorMessage;
return (
<AnimatePresence>