@@ -4,21 +4,22 @@ defmodule SWAPIWeb.GraphQL.Resolvers.SpeciesResolver do
44 """
55
66 alias SWAPI.Species
7+ alias SWAPI.Schemas.Species , as: SpeciesSchema
78
8- @ spec all ( map , map ) :: { :ok , list ( Species . t ( ) ) } | { :error , any }
9+ @ spec all ( map , map ) :: { :ok , list ( SpeciesSchema . t ( ) ) } | { :error , any }
910 def all ( _args , _info ) do
1011 { :ok , Species . list_species ( ) }
1112 end
1213
13- @ spec one ( map , Absinthe.Resolution . t ( ) ) :: { :ok , Species . t ( ) } | { :error , any }
14+ @ spec one ( map , Absinthe.Resolution . t ( ) ) :: { :ok , SpeciesSchema . t ( ) } | { :error , any }
1415 def one ( % { id: id } , _info ) do
1516 case Species . get_species ( id ) do
1617 { :ok , species } -> { :ok , species }
1718 { :error , :not_found } -> { :error , "Species not found" }
1819 end
1920 end
2021
21- @ spec search ( map , Absinthe.Blueprint . t ( ) ) :: { :ok , list ( Species . t ( ) ) } | { :error , any }
22+ @ spec search ( map , Absinthe.Blueprint . t ( ) ) :: { :ok , list ( SpeciesSchema . t ( ) ) } | { :error , any }
2223 def search ( % { search_terms: search_terms } , _info ) do
2324 { :ok , Species . search_species ( search_terms ) }
2425 end
0 commit comments