Hanums

Hanums

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

Showing Posts 1 to 10

Eiji

Eiji

Please take a look at this post:

Hanums

Hanums OP

Thank you for quick response. I am new to Elixir world and not used to the terminology yet.

Do you mean Elixir V1.7.0-rc.0 release fixed Absinthe compilation bug? My Elixir is 1.7.4 and believe higher version than V1.7.0-rc.0.

Confused now, appreciate more info.

Eiji

Eiji

@Hanums Looks like that absinthe is not yet ready for Elixir > 1.6.6. Try installing 1.6.6 version of Elixir and let us know if that solves your problem.

If I remember that topic well absinthe used some Elixir private API which have been changed. Also absinthe probably had planned big rework, but I’m not following it and I’m not sure if it’s done now.

If you want to give a try with 1.7.4 then you would need to try special git branch for new version of Elixir. Please see Git options ( :git ) documentation page which describes how to use such options properly.

kokolegorille

kokolegorille

I have been using Absinthe 1.4 with Elixir > 1.7

Here is my dependencies (Do not use 1.4.0, prefer 1.4)

      {:ecto, "~> 3.0", override: true},
      #
      {:absinthe, "~> 1.4"},
      {:absinthe_plug, "~> 1.4"},
      {:absinthe_ecto, "~> 0.1.3"},
      {:absinthe_relay, "~> 1.4"},
      {:absinthe_phoenix, "~> 1.4"},

I am overriding ecto because absinthe_relay requires ecto 2, but that is not required if You don’t use relay.

At least You need one query inside the query block. For example, You can try this…

  query do
    field :hello, :string do
      resolve fn _, _ -> {:ok, "world!"} end
    end
  end

In graphiql, You can query

{
  hello
}

And this would be the result.

{
  "data": {
    "hello": "world!"
  }
}

Do not forget to specify the json encoder in your router…

  scope "/" do
    pipe_through :api

    # Note: downloaded from CDN!
    forward "/graphiql",
      Absinthe.Plug.GraphiQL,
      schema: GraphqlWeb.Schema,
      json_codec: Jason
  end
benwilson512

benwilson512

Author of Craft GraphQL APIs in Elixir with Absinthe

Absinthe absolutely supports Elixir 1.7. However, you need one of the latest versions. @Hanums you should mix deps.update absinthe.

Eiji

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

Hanums

Hanums OP

Thank you Benwilson512 and code compiled successfully, but Error Absinthe.Schema.Error still persists. Now I am in the process of testing GraphQL and will post updates.

benwilson512

benwilson512

Author of Craft GraphQL APIs in Elixir with Absinthe

If you do mix deps|grep absinthe what version do you show?

Hanums

Hanums OP

warning: found quoted keyword “test” but the quotes are not required. Note that keywords are always atoms, even when quoted, and quotes should only be used to introduce keywords with foreign characters in them
mix.exs:76

  • absinthe 1.4.13 (Hex package) (mix)
    locked at 1.4.13 (absinthe) 81eb2ff4
  • 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
benwilson512

benwilson512

Author of Craft GraphQL APIs in Elixir with Absinthe

an you rm -rf _build ?

Where Next? Top

Trending in Questions Top

katta
I having some trouble figuring out if I have set myself too strict of standards for my production server. Currently I can handle 75% of r...
New
achenet
Hello, I’m trying to build a basic Phoenix web-app, and I’d like to use Tailwind. However, when I launch mix phx.server, I get an error...
New
peck
Hi everyone. My team and I have been working on a fairly modest app based around video streaming and chat, but we’ve landed a customer t...
New
bradley
I really like the adapter patterns that ecto, nebulex, waffle, etc. use and would love find something similar for a key management servic...
New
unaware8150
Hello folks! So at work, we are seeing some situations where we have to define some “fixed” strings that are used across the codebase in...
New
Cxx-mlr
I’m working on a small exercise involving update_in/3, and I came up with this solution: data = %{ name: "Periodic Table", category:...
New
Alvinkariuki
How Can I Optimise Compile Time Dependencies I have been building an elixir application for about 2 years now. Many modules and files ha...
New

Other Trending Topics Top

GenericJam
Edit: 2026 May 15 - This post is archived. Mob is alive!! Main docs: mob v0.7.11 — Documentation A bit of explanation for the slightly c...
New
budgie
A little off-topic, but I feel like people here have a good head on their shoulders. I used to be quite good at making software. Was luc...
New
KristerV
Hey. Is there anyone here who creates agents in their apps? Not talking about using agents, but creating them. I’m finding it pretty diff...
New
mudasobwa
I fully migrated to my own harness from Anthropic/Gemini and I think it’s time to share it. Welcome DSH, the DeepSeek Harness, fully writ...
New
jimsynz
Beam Bots (or just BB for short) is a framework for building fault-tolerant robotics applications in Elixir using familiar OTP patterns. ...
New
juhalehtonen
There has been a thread to discuss the Stack Overflow Developer Survey on this forum every year since 2018, so here’s yet another one for...
New

We're in Beta

About us Mission Statement

Options

Thread Display Mode




Thread Preview

Skip Thread Previews