I got some problem when develop graphql api.
I followed absinthe schema rule and built an api.
And it’s running well by using iex -S mix phx.server
But after I run mix compile
I got the error below:
== Compilation error in file lib/rock_store_web/schema.ex ==
** (Absinthe.Schema.Error) Invalid schema:
Elixir.RockStoreWeb.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.
Always check with the latest version. At the time 1.4.12 was released there was no RC available, and only RCs can be considered stable (enough) to be worth the effort
Trying to keep up master can become very tedious at times, so I understand the stance to support only released versions and only test/implement against them once the first RC has been published.