Skip to content

How to use useAsyncData and Supabase in composable while preserving type prediction? #267

Open
@Zebnastien

Description

@Zebnastien

Hello everyone,

Using Supabase and Nuxt is smooth as butter thanks to this module. Thanks to all the teams for the wonderful work! 👍🏼

I am trying to implement a composable to manage my calls.
So I started with the example from the NuxtSupabase documentation:

image

This works fine, and I can see the return type.
Now I want to centralize some logic in a composable. Here is my solution:

image

And the associated composable useDatabase:

image

This all works fine, but I lose the Supabase client return type prediction.
No matter how much I try different ways of doing things, I systematically lose type inference.

How to manage the Supabase client with useAsyncData in separate composable while benefiting from type prediction?
Am I missing something?

Metadata

Metadata

Assignees

No one assigned

    Labels

    questionFurther information is requested

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions