function decorateError(error) {
  if (
    error.response &&
    error.response.body &&
    Array.isArray(error.response.body.errors)
  ) {
    const first = error.response.body.errors[0];

    error.locations = first.locations;
    error.path = first.path;
    error.extensions = first.extensions;
  }

  return error;
}
Decorates an `Error` object with details from GraphQL errors in the response
body.

@param {Error} error The error to decorate
@return {Error} The decorated error
@private