by @abooij
Return type: MUST be SETOF <table-name>
https://hasura.io/docs/1.0/graphql/manual/schema/custom-functions.html#supported-sql-functions
Computed fields whose associated SQL function returns a base type like Integer, Boolean, Geography etc. are scalar computed fields.
https://hasura.io/docs/1.0/graphql/manual/schema/computed-fields.html#computed-field-types
There is a seeming inconsistency in the docs here: are supported SQL functions allowed to have non-setof return types? The former says it's not, the latter says it is. The answer is that SQL functions can be used in three different places:
setof <table>: query q {
author(..) {
first_name
last_name
full_name
}
search_articles(args: {..}) {}
}
Most helpful comment
i don't think the
scalar computed fieldis working. i keep getting