SupabaseS
Supabase•3y ago
kgni

Redux Toolkit Query & autogenerated Supabase types

Hi guys!

I know that this is probably more a RTK Query/Typescript question, than a Supabase one - but I just want to see if someone has ever done what I'm trying to do or if someone can help me out.

I'm trying to setup RTK Query with Supabase and Supabase autogenerated types.

I'm running into an issue, typing the builder.query return type to satisfy the typescript typechecker.

What I think I want to do, is to pass in the type that I receive from the Supabase query method, as an argument to the RTK Query builder.query method.

I could of course manually create an interface and type it to be the same as what Supabase automatically has returned to me, but I want to see if I can get around this and just let the auto generated Supabase types rule everything.

Please see thread for examples

Thanks in advance!

And sorry in advance if my explanation is completely trash 😄
Was this page helpful?