diff --git a/framework/vendure/fetcher.ts b/framework/vendure/fetcher.ts index bf8f0dcd8..26e1eec28 100644 --- a/framework/vendure/fetcher.ts +++ b/framework/vendure/fetcher.ts @@ -41,11 +41,13 @@ export const fetcher: Fetcher = async ({ headers, credentials: 'include', }) - if (res.ok) { - const { data } = await res.json() + const { data, errors } = await res.json() + if (errors) { + throw await new FetcherError({ status: res.status, errors }) + } return data } - + throw await getError(res) }