https://supabase.com/ logo
#help
Title
# help
p

pcj127

04/03/2022, 7:16 PM
I'm calling a plpgsql function in the same way that the generated API docs recommend (supabase-js):
Copy code
js
await client.rpc<Foo>('create_foo', { name }).select().single();
function:
Copy code
sql
CREATE OR REPLACE FUNCTION create_foo(
  "name" text
) 
RETURNS setof foo 
...
But getting this following error:
Copy code
sh
404 Not Found: Could not find the public.create_foo() function or the public.create_foo function with a single unnamed json or jsonb parameter in the schema cache (undefined)
Any idea what I could be missing?
n

Needle

04/03/2022, 7:16 PM
Hello ! This thread has been automatically created from your message in a ``few seconds ago``. Pinging @User so that they see this as well! Want to unsubscribe from this thread? Right-click the thread in Discord (or use the ... menu) and select Leave Thread to unsubscribe from future updates. Want to change the title? Use the
/title
command! We have solved your problem? Click the button below to archive it.
g

garyaustin

04/03/2022, 7:21 PM
Might be parameter should be {name:'namevalue'}
n

Needle

04/03/2022, 7:21 PM
pcj127 (2022-04-03)
p

pcj127

04/03/2022, 7:40 PM
Yeah, I think that's correct. One of my arguments turned out to be undefined/empty string, triggering the error message (not the best error message ever, but...). I'm unblocked now, thanks.
n

Needle

04/03/2022, 7:41 PM
Thread was archived by @pcj127. Anyone can send a message to unarchive it.