-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Closed
Labels
c/consoleRelated to consoleRelated to consoledesign-rfcPicked up by product design team for RFCPicked up by product design team for RFCe/easycan be wrapped up in a couple of dayscan be wrapped up in a couple of daysk/enhancementNew feature or improve an existing featureNew feature or improve an existing feature
Description
We can create custom postgres functions that are taking some arguments, for example:
CREATE TABLE text_result(
result text
);
CREATE
OR REPLACE FUNCTION customFunctionWithSessionArg(
customNameForSessionArg json, name text
) RETURNS SETOF text_result LANGUAGE sql STABLE AS $$
SELECT
q.*
FROM
(
VALUES
(customNameForSessionArg ->> 'x-hasura-role')
) q $$Then we can track it with track_function v2:
https://hasura.io/docs/1.0/graphql/manual/api-reference/schema-metadata-api/custom-functions.html#
And tell Hasura to fill customNameForSessionArg with the session argument:
{
"type": "track_function",
"version": 2,
"args": {
"function": {
"schema": "public",
"name": "get_session_role"
},
"configuration": {
"session_argument": "customNameForSessionArg"
}
}
}What needs to be done:
- Add text input on the function modify page that allows users to set and edit session_argument.
- Track this function with the session argument.
MaxmaxmaximusGitHub
Metadata
Metadata
Assignees
Labels
c/consoleRelated to consoleRelated to consoledesign-rfcPicked up by product design team for RFCPicked up by product design team for RFCe/easycan be wrapped up in a couple of dayscan be wrapped up in a couple of daysk/enhancementNew feature or improve an existing featureNew feature or improve an existing feature