You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When working with a custom function, I am having an issue that seems to defy the docs. I have a custom function that gets the user id from x-hasura-user-id and updates a table.
My custom function signature is:
CREATE OR REPLACE FUNCTION db.make_an_update(hasura_session json)
RETURNS TABLE(after_updated db.some_table)
LANGUAGE sql VOLATILE
AS $function$
...
WHERE
user_id = ((hasura_session ->> 'x-hasura-user-id')::text)
RETURNING
*;
$function$
This function is tracked, and tested outside of hasura to make sure it works. The tracking metadata is specified as such:
function:
name: make_an_update
schema: db
configuration:
custom_root_fields: {}
session_argument: hasura_session
The issue I am having is that when making a mutation query, i am getting the error missing required field 'args', but when trying to specify empty args, like make_an_update(args:{}), I am getting the error Non default arguments cannot be omitted.
Based on the docs, I have the hasura_session specified in the metadata, and the function is working as expected and tracked, I have tried creating as VOLATILE and not, but cannot get past this args required error.
I tried working with both hasura versions 2.11.1 and 2.12.0-ce
After doing some debugging, it looks like when calling the mutation, it is expecting after_updated as a valid args which seems like a bug because it is not a function argument.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
When working with a custom function, I am having an issue that seems to defy the docs. I have a custom function that gets the user id from
x-hasura-user-id
and updates a table.My custom function signature is:
This function is tracked, and tested outside of hasura to make sure it works. The tracking metadata is specified as such:
The issue I am having is that when making a mutation query, i am getting the error
missing required field 'args'
, but when trying to specify empty args, likemake_an_update(args:{})
, I am getting the errorNon default arguments cannot be omitted
.Based on the docs, I have the
hasura_session
specified in the metadata, and the function is working as expected and tracked, I have tried creating asVOLATILE
and not, but cannot get past thisargs
required error.I tried working with both hasura versions
2.11.1
and2.12.0-ce
After doing some debugging, it looks like when calling the mutation, it is expecting
after_updated
as a validargs
which seems like a bug because it is not a function argument.Beta Was this translation helpful? Give feedback.
All reactions