When I do this
import_types(Web.GraphQL.Types.{
PublicKey,
Friendship,
User,
Account,
VoiceMessage,
Contact,
Crash,
Complaint
})
I get
== Compilation error in file lib/web/graphql/schema.ex ==
** (ArgumentError) module Elixir.Web.GraphQL.Types.Friendship is not available
lib/absinthe/schema/notation.ex:1269: anonymous fn/4 in Absinthe.Schema.Notation.do_import_types/2
(elixir) lib/enum.ex:1899: Enum."-reduce/3-lists^foldl/2-0-"/3
lib/absinthe/schema/notation.ex:1263: Absinthe.Schema.Notation.do_import_types/2
expanding macro: Absinthe.Schema.Notation.import_types/1
lib/web/graphql/schema.ex:10: Web.GraphQL.Schema (module)
(elixir) lib/kernel/parallel_compiler.ex:198: anonymous fn/4 in Kernel.ParallelCompiler.spawn_workers/6
but if I require Friendship
,
require Web.GraphQL.Types.Friendship
import_types(Web.GraphQL.Types.{
PublicKey,
Friendship,
User,
Account,
VoiceMessage,
Contact,
Crash,
Complaint
})
the error is raised for another module (now User
)
== Compilation error in file lib/web/graphql/anon_schema.ex ==
** (ArgumentError) module Elixir.Web.GraphQL.Types.User is not available
lib/absinthe/schema/notation.ex:1269: anonymous fn/4 in Absinthe.Schema.Notation.do_import_types/2
(elixir) lib/enum.ex:1899: Enum."-reduce/3-lists^foldl/2-0-"/3
lib/absinthe/schema/notation.ex:1263: Absinthe.Schema.Notation.do_import_types/2
expanding macro: Absinthe.Schema.Notation.import_types/1
lib/web/graphql/anon_schema.ex:9: Web.GraphQL.AnonSchema (module)
(elixir) lib/kernel/parallel_compiler.ex:198: anonymous fn/4 in Kernel.ParallelCompiler.spawn_workers/6
and in a different schema … But that’s probably not important (require
ing it there also solves the issue).