Hanums
Elixir 1.7.4, Absinthe compilation error: The root query type must be implemented and be a of type Object
I am receiving below error at mix compile. I tried to downgrade but received error on Mac. Help please…
$ brew switch elixir 1.6.6
Error: elixir does not have a version "1.6.6" in the Cellar.
elixir installed versions: 1.7.4
I am at Elixir 1.7.4 and deps are
{:absinthe, "~> 1.4.0"},
{:absinthe_plug, "~> 1.4.0"},
{:absinthe_ecto, "~> 0.1.3"},
The root query type must be implemented and be a of type Object
#Example
defmodule MyApp.Schema do
use Absinthe.Schema
query do
#Fields go here
end
end
From the graqhql schema specifiation
A GraphQL schema includes types, indicating where query and mutation
operations start. This provides the initial entry points into the type system.
The query type must always be provided, and is an Object base type. The
mutation type is optional; if it is null, that means the system does not
support mutations. If it is provided, it must be an object base type.
Reference: https://facebook.github.io/graphql/#sec-Initial-types
lib/absinthe/schema.ex:271: Absinthe.Schema.__after_compile__/2
(stdlib) lists.erl:1263: :lists.foldl/3
(stdlib) erl_eval.erl:680: :erl_eval.do_apply/6
(elixir) lib/kernel/parallel_compiler.ex:206: anonymous fn/4 in Kernel.ParallelCompiler.spawn_workers/6
Marked As Solved
Eiji
My bad - this question just reminded me this old issue and I just checked if 1.7-issue branch is still there and it is. I had just took a look at branches details and found:
1.7-issue Updated 6 months ago by benwilson512
Also Liked
benwilson512
dimitarvp
That’s why I posted above. Just wanted to add one more voice to the fact that Elixir 1.7.4 and Absinthe 1.3 combo leads to compilation errors. And that upgrading to 1.4 fixes it.
![]()
dimitarvp
What Ben recommended to you is not Elixir-specific. It’s a Linux command.
Delete your _build and deps directories (at the root of your project) and then execute this:
mix do deps.get, compile
Popular in Questions
Other popular topics
Categories:
Sub Categories:
Forums
Popular Tags
- #ecto
- #liveview
- #troubleshooting
- #learning-elixir
- #deployment
- #library
- #erlang
- #testing
- #genserver
- #mix
- #absinthe
- #remote-other
- #otp
- #plug
- #how-to-question
- #macros
- #postgres
- #channels
- #elixirconf
- #exunit
- #discussion
- #code-sync
- #javascript
- #podcasts
- #onsite
- #dialyzer
- #docker
- #authentication
- #umbrella
- #full-time-contract
- #podcasts-by-brainlid
- #ecto-query
- #elixir-ls
- #phoenix_html
- #iex
- #blog-post
- #graphql
- #genstage
- #ai
- #websockets
- #supervisor
- #advent-of-code
- #elixirconf-us
- #distillery
- #processes
- #forms
- #api
- #metaprogramming
- #security
- #performance









