Hasura API explorer behaving a bit different than Raw SQL runner's results. I have this custom function.
CREATE
OR REPLACE FUNCTION public.session_groupings( group_bys TEXT[] DEFAULT '{}', "sessionWhere" json default null ) RETURNS SETOF session_groupings_type LANGUAGE sql STABLE AS $$
SELECT
When I run
select session_groupings('{country}', '{"project_id": {"_eq": "951f4001-36fc-4bb7-9d87-e37bd4c56502"},"created_at": {"_gte": "05-10-2021" ,"_lte": "06-10-2021" }}')
This gives me the right results. But when I run it with API explorer the results are wrong I am calling it like
query MyQuery($sessionWhere: json, $group_bys: _text) {
session_groupings(args: {sessionWhere: $sessionWhere, group_bys: $group_bys}) {
country_name {
name
}
count
}
}
then the variables are like so
{
"group_bys": "{country}",
"sessionWhere": {
"project_id": {"_eq": "951f4001-36fc-4bb7-9d87-e37bd4c56502"},
"created_at": {"_gte": "05-10-2021" ,"_lte": "06-10-2021" }
}
}
Am I calling it the wrong way?