pg_graphql icon indicating copy to clipboard operation
pg_graphql copied to clipboard

Logging and errors during schema generation

Open cazzer opened this issue 11 months ago • 1 comments

Heyyy Supabase fam! Absolutely loving this extension, thanks for supporting it!

TL;DR There are a few explicit limitations for the schema generation and a few undocumented, (though reasonable ones). Would be awesome to see the schema generator's logs to more quickly find the offending issue for a table or function in question.

More details on my instance if you're curious...I was trying to expose a function similar to the following:

create or replace function search_function(
  a integer,
  b integer
)
  returns table (a integer, b integer, sum integer)
  language sql
  immutable
as $function$
  select
    a as a,
    b as b,
    a + b as sum;
$function$;

This function won't be exposed, which baffled me for far too long before I finally realized I super just need to return an id field in the response structure. My actual use case returned three different ID-ish fields, (I was union-ing some tables and pulled each ID back in separate columns) which is why I didn't think to have an additional id column.

cazzer avatar Feb 07 '25 17:02 cazzer

I didn't totally follow the limitation you're referring to here. Could you provide an example function that isn't reflected and the change you made such that it is reflected?

Limitations are documented here https://supabase.github.io/pg_graphql/functions/#limitations

PRs welcome if you'd like to add anything we missed

olirice avatar Feb 18 '25 20:02 olirice