Skip to content

Instantly share code, notes, and snippets.

@sapandiwakar
Last active March 8, 2023 07:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sapandiwakar/2585851aa844b9cbf4f7fb812f049ca5 to your computer and use it in GitHub Desktop.
Save sapandiwakar/2585851aa844b9cbf4f7fb812f049ca5 to your computer and use it in GitHub Desktop.
Supplementary Code for AppSignal post named "An Introduction to Absinthe"
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