Skip to main content

@rtorcato/supabase-common / unwrap

Function: unwrap()

unwrap<T>(result): T

Defined in: unwrap.ts:33

Return data, or throw SupabaseError if the result carried an error. Also throws when both data and error are null (an unexpected empty result), so a null return always means the row genuinely doesn't exist.

const user = unwrap(await supabase.from('users').select().single())

Type Parameters

T

T

Parameters

result

PostgrestLike<T>

Returns

T