hasura / hasura/graphql-engine
Support arbitrary return type for custom SQL functions
- Dominant language
- TypeScript
- Stars
- 32.1k
- Forks
- 3k
- PR merge metrics
- PR metrics pending
Description
According to [Hasura documentation](https://hasura.io/docs/1.0/graphql/manual/schema/custom-functions.html#creating-exposing-sql-functions), only `SETOF ` is a valid return type for Hasura to be able to track custom functions. A helpful note recommends creating an empty table as a workaround. But this imposes a lot of extra development and schema management.
Would it be easy to support custom / on-the-fly table definitions? For example:
```
CREATE OR REPLACE FUNCTION test_function()
RETURNS TABLE(intFirst INT, bSecond BOOLEAN, randomData JSONB) AS $$
SELECT 1, TRUE, '{"fake": "data"}'::JSONB;
$$ LANGUAGE SQL STABLE;
```
Contributor guide
Assessment
This issue has not been assessed yet.