-
-
Save sapandiwakar/2585851aa844b9cbf4f7fb812f049ca5 to your computer and use it in GitHub Desktop.
Supplementary Code for AppSignal post named "An Introduction to Absinthe"
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
defmodule MyAppWeb.Schema.Resolvers.Blog do | |
alias MyApp.Blog | |
alias MyApp.Blog.Post | |
def post_author(%Post{author_id: id}, _args, _res) do | |
{:ok, Blog.get_author!(id)} | |
end | |
def list_posts(_args, _res), do: {:ok, Blog.list_posts()} | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment