Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Project does not compile #2

Open
baleeds opened this issue Oct 6, 2018 · 3 comments
Open

Project does not compile #2

baleeds opened this issue Oct 6, 2018 · 3 comments

Comments

@baleeds
Copy link

baleeds commented Oct 6, 2018

I have downloaded the project and run the proper commands, and the database is being created with the appropriate tables. However running the server results in this message:

== Compilation error in file lib/community/web/schema.ex ==
** (Absinthe.Schema.Error) Invalid schema:
Elixir.Community.Web.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:230: Absinthe.Schema.__after_compile__/2
    (stdlib) lists.erl:1263: :lists.foldl/3
    (stdlib) erl_eval.erl:670: :erl_eval.do_apply/6
    (elixir) lib/kernel/parallel_compiler.ex:206: anonymous fn/4 in Kernel.ParallelCompiler.spawn_workers/6

Any ideas what's happening here? Perhaps absinthe has made breaking changes since the project was last working?

@jaizquierdogalan
Copy link

I have the same error, @baleeds did you fix it?

@twillzy
Copy link

twillzy commented Mar 12, 2019

@baleeds and @izquierdogalan
Try upgrading your deps to the latest version

      {:absinthe_ecto, "~> 0.1.3"},
      {:absinthe_plug, "~> 1.4"},

@cclark
Copy link

cclark commented Mar 21, 2019

Following up on @twillzy, it worked for me when I updated those dependencies but I also had to add plug_cowboy so it ended up being

{:plug_cowboy, "~> 1.0"},
{:absinthe_ecto, "~> 0.1.3"},
{:absinthe_plug, "~> 1.4"},

I tried creating a PR against https://github.com/howtographql/howtographql which is where I suspect most people reading this are coming from and encountering the error however I'm not able to get that project to run due to missing deps.

krlsdu added a commit to krlsdu/graphql-elixir that referenced this issue Sep 7, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants