Replies: 1 comment 1 reply
-
Alternatives: Computed fields allow you to return scalar values (which may include a json string) but they cannot be mutations. |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I wrote a stored procedure to allow unauthenticated users to login and get a JWT token from the database. This stored proc uses a table called sessions to keep track of logins. The session has an id, user id, start time, end time and jwt as columns.
I then exposed this function as a mutation in hasura. Here are the problems.
in postgres I can set the function as security definer. Can something similar be done with hasura. If not what's a good way to deal with this?
I tried returning a setof some_custom_type_thats_not_a_table but that doesn't work either. I would be great if hasura just allowed me to return a JSON from a function or something.
Thanks.
Beta Was this translation helpful? Give feedback.
All reactions