Building a Forum Elixir GraphQL Backend with Absinthe
Setting up a Phoenix app with Absinthe to serve our data layer over GraphQL
Setting up a Phoenix app with Absinthe to serve our data layer over GraphQL
@knewter
Previously, we built the data model for a Forum as one app in an umbrella application. Today we'll add a Phoenix app to the umbrella and use Absinthe to provide access to the data model via GraphQL for end users.
We'll begin by creating the Phoenix application itself. We don't need Ecto, because our data layer manages the interaction with the database, and we don't need webpack
cd apps # If you don't already have the latest installer mix archive.install hex phx_new 1.4.0 mix phx.new firestorm --no-ecto --no-webpack cd firestorm
Now that we have a Phoenix app, we'd like to introduce our initial dependencies. We need
absinthe
and
absinthe_plug
for absinthe itself. We also depend on our data layer from the umbrella.
# mix.exs defmodule Firestorm.Mixfile do # ... defp deps do [ # ... {:absinthe, "~> 1.4"}, {:absinthe_plug, "~> 1.4"}, {:firestorm_data, in_umbrella: true} ] end end
We'll fetch the dependencies:
mix deps.get
In our...
To see the complete version of this and more awesome lesson
become a superuser
Comments for Building a Forum Elixir GraphQL Backend with Absinthe