例如,我想在以下 Absinthe 模式中调用前端的inserted_on
时间戳:created_at
defmodule MyAppWeb.Schema.AccountTypes do
use Absinthe.Schema.Notation
object :user do
field :id, :id
field :email, :string
field :inserted_on, :datetime
end
end
但我不确定如何设置 Ecto <-> Absinthe 映射。我应该在我的 Ecto 架构中添加一个虚拟字段吗?