         arg :text, non_null(:string)
 
         resolve fn %{title: title, author: author, text: text}, _ ->
-          case Virgil.Poems.create_poem(%{title: title, author: author, text: text}) do
-            {:ok, poem} ->
+          case Poems.create_poem(%{title: title, author: author, text: text}) do
+            {:ok, poem = %Poems.Poem{}} ->
               {:ok, poem}
             _ ->
               {:error, nil}

defmodule VirgilWeb.Api.Schema do
  use Absinthe.Schema

  object :poem do
    field :id, non_null(:id)


    field :poems, non_null(list_of(:poem)) do
      resolve fn _, _ ->
        {:ok, Poems.list_poems()}
      end
    end
  end
