Open
Description
Bug report
- I confirm this is a bug with Supabase, not with my own application.
- I confirm I have searched the Docs, GitHub Discussions, and Discord.
Describe the bug
Supabase supports filtering RPC results via postgrest but the type system shows an error when attempting to do so
Errors show up as Property 'eq' does not exist on type 'PostgrestTransformBuilder<...>
but the query still works as expected.
To Reproduce
Minimal reproduction is available in the gwax/rpc-filtering
branch here: https://github.com/manapoolinc/supabase-playground/tree/gwax/rpc-filtering
- Make a table returning rpc: https://github.com/manapoolinc/supabase-playground/blob/gwax/rpc-filtering/supabase/migrations/20250127194033_create_country_fns.sql#L1
- Query the rpc with a select and a filter: https://github.com/manapoolinc/supabase-playground/blob/gwax/rpc-filtering/src/lib/db/countries.ts#L35
- See type error in IDE, compiler, linter: https://github.com/manapoolinc/supabase-playground/blob/gwax/rpc-filtering/src/lib/db/countries.ts#L53
Essentially:
const result = await supabase
.rpc(...)
.select(...)
.eq(...); // <-- This causes the error
Expected behavior
No Type Errors in reproduction code
System information
- Version of supabase: 2.6.8
- Version of supabase-js: 2.48.1