Absinthe: Error during compilation of schema

Created on 18 Sep 2016  路  1Comment  路  Source: absinthe-graphql/absinthe

== Compilation error on file web/schema.ex ==
** (UndefinedFunctionError) function App.Schema.Types.__absinthe_types__/0 is undefined (module App.Schema.Types is not available)
    App.Schema.Types.__absinthe_types__()
    Absinthe.Schema.Notation.do_import_types/2
    expanding macro: Absinthe.Schema.Notation.import_types/1
    web/schema.ex:6: App.Schema (module)
    (elixir) lib/kernel/parallel_compiler.ex:116: anonymous fn/4 in Kernel.ParallelCompiler.spawn_compilers/1

Am getting this error when trying to compile or launch a phoenix app with absinthe and absinthe-plug.
Believe I have followed documentation exactly...

using Elixir 1.3.2 on Debian 8

{:absinthe, "~> 1.1.0", {:absinthe_plug, "~> 1.1"} as deps to the phoenix project.

web/schema/types.ex:

defmodule App.Schema.Types do
  use Absinthe.Schema.Notation

  @desc "An artifact"
  object :artifact do
    field :id, :id
    field :title, :string
    field :body, :string
    field :author, :string
    field :source, :artifact_source
  end

  @desc "The source of an artifact"
  enum :artifact_source do
    value :reddit, description: "A Reddit Post"
    value :twitter, description: "A Tweet"
    value :facebook, description: "A Facebook Post or Comment"
    value :wikipedia, description: "A Wikipedia Article"
    value :youtube, description: "A YouTube Video or Comment"
    value :instagram, description: "An Instragram Post"
  end
end

web/schema.ex:

defmodule App.Schema do
  use Absinthe.Schema

  alias App.Resolver

  import_types App.Schema.Types

  query do
    field :artifacts, list_of(:artifact) do
      arg :search, non_null(:string)
      resolve &Resolver.Artifact.search/2
    end
  end
end

Any help is much appreciated!

Most helpful comment

bahh i figured it out...
files were not in the web directory of the phoenix app it turns out..
Whoops, closing.

>All comments

bahh i figured it out...
files were not in the web directory of the phoenix app it turns out..
Whoops, closing.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

rawkode picture rawkode  路  4Comments

jfrolich picture jfrolich  路  5Comments

bruce picture bruce  路  4Comments

scf4 picture scf4  路  3Comments

ivawzh picture ivawzh  路  3Comments