Getting Absinthe.Blueprint.TypeReference.unwrap error in Phoenix?

I am new to Elixir ans Phoenix-Framework, So i was trying to make a simple GraphQL backend where we can add Photos and Retrieve them but i am getting this weird error whenever i start my server. enter image description here

This is my schema.ex file:-

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

This is my Resolver that i am using

defmodule ServerWeb.Resolvers.Posts do
  alias Server.Posts

  def photos(_, _, _) do
    {:ok, Posts.list_photos}
  end
end

And this is my PostTypes.ex file

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

Can anyone help me to solve this error? Just for some more context these are my dependecies:-

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

Hi @necromorph23 you have a small typo:

field :inserted_at, non null(:string)
should be
field :inserted_at, non_null(:string)

Notice the _ between non and null.

3 Likes