I’m new to api with Elixir and when I write mix phx.server in the project I get an error like this
== Compilation error in file lib/blog_app/repo.ex ==
** (ArgumentError) missing :adapter option on use Ecto.Repo
(ecto 3.7.2) lib/ecto/repo/supervisor.ex:57: Ecto.Repo.Supervisor.compile_config/2
lib/blog_app/repo.ex:2: (module)
my repo.ex file
defmodule BlogApp.Repo do
use Ecto.Repo, otp_app: :blog_app
@doc """
Dynamically loads the repository url from the
DATABASE_URL environment variable.
"""
def init(_, opts) do
{:ok, Keyword.put(opts, :url, System.get_env("DATABASE_URL"))}
end
end
(CompileError) module Absinthe.Ecto is not loaded and could not be found. This may be happening because the module you are trying to load directly or indirectly depends on the current module
This is now a very different error.
It seems you are trying to build a GraphQL API with Absinthe?
For better help, we need to see more of the project. Maybe a Github repo?
This might even be better under a new post, as the title of the post is resolved.
But if you don’t, I suggest you take everything out and build the project slowly.
Add Ecto, get it working, then Absinthe, then etc…