我正在尝试使用 hasura API 在模式“abc”中将计算字段添加到我的 graphql 表“用户”,但收到以下错误:
Saving computed field failed
in table "abc.user": in computed field "full_name": the computed field "full_name"
cannot be added to table "abc.user" because the function "abc.fullname" is
of type VOLATILE; cannot be added as a computed field
该功能已正确添加:
CREATE OR REPLACE FUNCTION abc.fullname(userrow abc.user)
RETURNS TEXT AS $$
BEGIN
SELECT userrow.first_name || ' ' || userrow.last_name;
END;
$$ LANGUAGE plpgsql;
我可以从下拉列表中选择函数“全名”,但在添加计算字段时出现错误。任何指导表示赞赏。谢谢你。