hasura / hasura/graphql-engine
Metadata field for session argument in functions is not documented
- Dominant language
- TypeScript
- Stars
- 32.1k
- Forks
- 3k
- PR merge metrics
- PR metrics pending
Description
I had to dig into the codebase and make my best guess at how the metadata YAML should be for specifying a session argument to a custom-tracked function.
In general, figuring out the shape of these documents is not straightforward, and I think it could use a JSON-schema spec or be documented somewhere visible. For the record this is how to add it:
```sql
create or replace function search_foo(keyword text, h_session jsonb) returns public.foos as
$$
select * from foos;
$$ language sql stable;
```
```yaml
function:
name: search_foo
schema: public
configuration:
session_argument: h_session
permissions:
- role: customer
```
Contributor guide
Assessment
This issue has not been assessed yet.