问题描述
我是 Elixir 和 Phoenix-Framework 的新手,所以我试图制作一个简单的 GraphQL 后端,我们可以在其中添加照片并检索它们,但是每当我启动我的服务器时,我都会收到这个奇怪的错误。
这是我的 schema.ex 文件:-
defmodule ServerWeb.Schema do
use Absinthe.Schema
alias ServerWeb.Resolvers
import_types __MODULE__.PostsTypes
query do
field :photos,list_of(:photo) do
resolve &Resolvers.Posts.photos/3
end
end
end
这是我正在使用的解析器
defmodule ServerWeb.Resolvers.Posts do
alias Server.Posts
def photos(_,_,_) do
{:ok,Posts.list_photos}
end
end
这是我的 PostTypes.ex 文件
defmodule ServerWeb.Schema.PostsTypes do
use Absinthe.Schema.Notation
object :photo do
field :id,non_null(:string)
field :image_url,non_null(:string)
field :caption,:string
field :inserted_at,non null(:string)
field :updated_at,non_null(:string)
end
end
谁能帮我解决这个错误?只是为了更多的上下文,这些是我的依赖:-
defp deps do
[
{:phoenix,"~> 1.5.8"},{:phoenix_ecto,"~> 4.1"},{:ecto_sql,"~> 3.4"},{:ecto,"~> 3.6"},{:postgrex,">= 0.0.0"},{:phoenix_live_dashboard,"~> 0.4"},{:telemetry_metrics,{:telemetry_poller,{:gettext,"~> 0.11"},{:jason,"~> 1.0"},{:plug_cowboy,"~> 2.0"},{:absinthe,"~> 1.6"},{:absinthe_plug,"~> 1.5"},{:DataLoader,"~> 1.0.0"}
]
end
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)