diff --git a/packages/graphql-playground-react/src/state/sessions/fetchingSagas.ts b/packages/graphql-playground-react/src/state/sessions/fetchingSagas.ts index 43a2042a5..8cd89dcd2 100644 --- a/packages/graphql-playground-react/src/state/sessions/fetchingSagas.ts +++ b/packages/graphql-playground-react/src/state/sessions/fetchingSagas.ts @@ -237,6 +237,11 @@ export function formatError(error, fetchingSchema: boolean = false) { function extractMessage(error) { if (error instanceof Error) { + // Errors from apollo-link-http may include a "result" object, which is a JSON response from + // the server. We should surface that to the client + if (!!error['result'] && typeof error['result'] === 'object') { + return (error as any).result + } return error.message }