Using Ecto v2.2.6, Phoenix 1.3
I am using absinthe for my blog app. My mix.exs:
{:absinthe, "~> 1.3.0-rc.0"},
{:absinthe_plug, "~> 1.3.0-rc.0"},
{:absinthe_ecto, git: "https://github.com/absinthe-graphql/absinthe_ecto.git"},
My app has two contexts, with several schemas listed in each:
Accounts:
Users,
Following (user-user linking table)
Content:
Posts,
Likes (user-post linking table),
Repost (user-post linking table)
I have a types.ex
file and a schema.ex
file. Types starts with:
defmodule Blog.Schema.Types do
use Blog.Schema.Notation
use Blog.Ecto, repo: Blog.Repo
object :user do ...
…and lists all of the types. schema.ex
starts with:
defmodule Blog.Schema do
use Absinthe.Schema
import_types Blog.Schema.Types
query do ...
My queries/mutations all work, except for the :following
. When I try to get a list_of(:following)
, the console says:
...schema.ex:72: Followings :following is not defined in your schema.
Types must exist if referenced.
But when I cut the object declaration from types.ex
and paste it into schema.ex
(plus the appropriate use
directives), right before the query directives, it works just fine. It’s only this one object, which seems no different from the others.
How does absinthe read the object
declarations? Is it possible that elixir is somehow caching something when I run phx.server
?