I ran into an issue where a plpgsql function I wrote was not being exposed to GraphQL via Postgraphile. The issue is that the function returned a RECORD whereas it needs to return a defined TYPE which is consistent across function calls. When I changed to a defined type (via CREATE TYPE example_type AS (value text, id int); Postgraphile was able to detect it and it was exposed via GraphQL.
I ran into an issue where a plpgsql function I wrote was not being exposed to GraphQL via Postgraphile. The issue is that the function returned a RECORD whereas it needs to return a defined TYPE which is consistent across function calls. When I changed to a defined type (via
CREATE TYPE example_type AS (value text, id int);
Postgraphile was able to detect it and it was exposed via GraphQL.https://www.graphile.org/postgraphile/function-restrictions/ could add the following not so that future users don't get confused:
We do not support functions which return the type RECORD, as GraphQL must know a predictable set of values to return.