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
defmodule MyApp.Schema do
query do #Fields go here
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.