© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
SupabaseS
Supabase•3y ago•
9 replies
kibithe

rpc call returns a serialization error in kotlin

Please Help. This is the error message iam getting

AvailableItemsRepoImpl$searchAvailableItem$2' is not registered for polymorphic serialization in the scope of 'Function0'.
To be registered automatically, class AvailableItemsRepoImpl$searchAvailableItem$2' has to be '@Serializable', and the base class 'Function0' has to be sealed and '@Serializable'.
Alternatively, register the serializer for 'class AvailableItemsRepoImpl$searchAvailableItem$2' explicitly in a corresponding SerializersModule.

And this is how i have structured my classes

@Serializable
sealed interface AvailableItemsRepo {
suspend fun searchAvailableItem(query:String):List<AvailableItem>
}

@Serializable
class AvailableItemsRepoImpl @Inject constructor (val client: SupabaseClient) :
AvailableItemsRepo {

override suspend fun searchAvailableItem(query: String): List<AvailableItem> {

return client.postgrest.rpc(
function = "available_phone",
parameters = {
query
}
).decodeList<AvailableItem>().reversed()

}

}


iam using this plugin in gradle

id("org.jetbrains.kotlin.plugin.serialization") version "1.9.0"

Please any help will be greatly appreciated as I have been on this for days. Thanks in advance
Supabase banner
SupabaseJoin
Supabase gives you the tools, documentation, and community that makes managing databases, authentication, and backend infrastructure a lot less overwhelming.
45,816Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

RPC Call Returns Zero Rows But Function Works as Expected
SupabaseSSupabase / help-and-questions
4y ago
Timeout on RPC Call
SupabaseSSupabase / help-and-questions
3mo ago
RPC call return type in TypeScript not nullable
SupabaseSSupabase / help-and-questions
2w ago
Updating many2many relations with RPC call
SupabaseSSupabase / help-and-questions
4y ago