Supabase RPC functions return type shows a 2D array?

I defined the following function:
CREATE OR REPLACE FUNCTION public.get_single_customer(idparm integer)
 RETURNS TABLE(id integer, first_name text, last_name text, business_name text, phone text, email text, address_one text, address_two text, city text, state text, zip text, country text, is_tax_exempt boolean, classification text)
 LANGUAGE sql
AS $function$
  SELECT
    id, first_name, last_name, business_name, phone, email, address_one, address_two, city, state, zip, country, is_tax_exempt, classification
    FROM
  customer
    FULL JOIN customer_private ON customer_private.customer_id = customer.id
    WHERE customer.id = idParm
  LIMIT 1
$function$
;

I am calling it from the supabase client like this:
const getSingleCustomer = async (id: number) => {
  const { data, error } = await supabase
    .rpc('get_single_customer', { idparm: id });
  if (error != null) {
    throw new Error(error.message);
  }
  return data;
};

The return data, for some reason shows a return type of a 2D array. This is incorrect as the data is actually a 1D array?

This is what VSCODE shows as the return type:
const data: {
    id: number;
    first_name: string;
    last_name: string;
    business_name: string;
    phone: string;
    email: string;
    address_one: string;
    address_two: string;
    city: string;
    state: string;
    zip: string;
    country: string;
    is_tax_exempt: boolean;
    classification: string;
}[][]

This is causing erroneous TS errors. Is there perhaps something I'm doing wrong please help.
Screen_Shot_2022-12-07_at_7.02.35_PM.jpg
Was this page helpful?