I am running a hasura project and I am using compute field in hasura. How can I pass and get the header in the query? There is already an open issue, but people are talking about a workaround as well but it didn't work out for me.
Here is header: x-hasura-preferred-lang: de_de
Here is the query
CREATE OR REPLACE FUNCTION public.interest_translation_function(interest_row interest, hasura_session json)
RETURNS text
LANGUAGE sql
STABLE
AS $function$
SELECT
CASE
WHEN (hasura_session ->> 'x-hasura-preferred-lang' = 'en_us' AND T.en_us IS NOT NULL) THEN T.en_us
WHEN (hasura_session ->> 'x-hasura-preferred-lang' = 'de_de' AND T.de_de IS NOT NULL) THEN T.de_de
ELSE T.source
END
FROM i18n T
WHERE T.source = interest_row.name;
$function$
You can see for now I am using hasura_session which we will get from jwt, but I want to pass the header without jwt. any though on this
I am expecting to get translated value without passing token when the same table has permission