Closed maarekj closed 3 years ago
Since the commit 8508e946e113a772c75cc65360cd285b9f43dbf1 there is a bug in function ensureApolloError
ensureApolloError
This function is declared like this:
let ensureApolloError: t => t = error => %bs.raw(` function (error, makeApolloError) { var error = error || {}; if (Array.isArray(error.graphQLErrors)) { return error; } else if (error && typeof error.message === "string" && error.extensions) { return makeApolloError({graphQLErrors: [error]}); } else { return makeApolloError({networkError: ensureError(error)}) } } `)(error, make, ensureError)
The raw function takes 2 parameters in input, and it is called with 3 parameters.
I think in fix it, we need to do this:
let ensureApolloError: t => t = error => %bs.raw(` function (error, makeApolloError, ensureError) { var error = error || {}; if (Array.isArray(error.graphQLErrors)) { return error; } else if (error && typeof error.message === "string" && error.extensions) { return makeApolloError({graphQLErrors: [error]}); } else { return makeApolloError({networkError: ensureError(error)}) } } `)(error, make, ensureError)
Excellent, thanks! Sadly, there is a unit test for this that was failing, but I never hooked them up to run in github actions. :(
This is released in 1.1.1
Since the commit 8508e946e113a772c75cc65360cd285b9f43dbf1 there is a bug in function
ensureApolloError
This function is declared like this:
The raw function takes 2 parameters in input, and it is called with 3 parameters.
I think in fix it, we need to do this: