Absinthe: Compilation of schema fails with Elixir 1.7

Created on 30 Jul 2018  路  1Comment  路  Source: absinthe-graphql/absinthe

I just upgraded to the new version of Elixir and without changing anything from the code, I have a compilation error on my schema.

Downgrading to Elixir 1.6.6 allows me to compile the code.

Environment

  • Elixir version (elixir -v): Elixir 1.7.1
  • Absinthe version (mix deps | grep absinthe):

  • absinthe 1.4.12 (Hex package) (mix)
    locked at 1.4.12 (absinthe) 50e7a700

  • absinthe_plug 1.4.5 (Hex package) (mix)
    locked at 1.4.5 (absinthe_plug) f63d52a7
  • absinthe_ecto 0.1.3 (Hex package) (mix)
    locked at 0.1.3 (absinthe_ecto) 420b6812
  • absinthe_relay 1.4.3 (Hex package) (mix)
    locked at 1.4.3 (absinthe_relay) 2810de84

Actual behavior

** (Absinthe.Schema.Error) Invalid schema:
Elixir.MyAppWeb.Schema:0: 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:677: :erl_eval.do_apply/6
    (elixir) lib/kernel/parallel_compiler.ex:206: anonymous fn/4 in Kernel.ParallelCompiler.spawn_workers/6

Relevant Schema/Middleware Code

I have a really simple schema, all the fields are imported from other files:

query do
  import_fields(:node_queries)
  import_fields(:user_queries)
end

mutation do
  import_fields(:user_mutations)
end

Most helpful comment

Simply update to 1.4.13

>All comments

Simply update to 1.4.13

Was this page helpful?
0 / 5 - 0 ratings