elixir - 在凤凰城得到 Absinthe.Blueprint.TypeReference.unwrap 错误?
问题描述
我是 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, "~> 0.4"},
{:telemetry_poller, "~> 0.4"},
{:gettext, "~> 0.11"},
{:jason, "~> 1.0"},
{:plug_cowboy, "~> 2.0"},
{:absinthe, "~> 1.6"},
{:absinthe_plug, "~> 1.5"},
{:dataloader, "~> 1.0.0"}
]
end
解决方案
推荐阅读
- java - 如何在Android中将HTML页面下载为pdf?
- opencv - 获得清晰和连续轮廓opencv的问题
- python - 如何更正要在 python 中执行的 sql 查询?
- java - 在 docker 容器内生成的 Log4j 日志
- angularjs - 禁用日期字段
- java - 编写可测试的代码 - Junit Test
- aws-cli - 如何使用多个负载均衡器创建 aws fargate 服务
- wordpress - 如何在 WordPress 上的每个帖子内容中自动添加一些文本?
- python - 我可以用符号代替表达式吗?
- react-native - 将 react-native-snap-carousel 放入 ScrollView React Native 时不会在 Android 中滚动