File tree Expand file tree Collapse file tree
lib/swapi_web/graphql/queries Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11defmodule SWAPIWeb.GraphQL.Queries.FilmQueries do
22 use Absinthe.Schema.Notation
33
4+ alias SWAPIWeb.GraphQL.Resolvers.FilmResolver
5+
46 object :film_queries do
57 @ desc "Get all films."
68 field :all_films , list_of ( :film ) do
7- resolve ( & SWAPIWeb.GraphQL.Resolvers. FilmResolver. all / 2 )
9+ resolve ( & FilmResolver . all / 2 )
810 end
911
1012 @ desc "Get a film by ID."
1113 field :film , :film do
1214 @ desc "The ID of the film."
1315 arg ( :id , non_null ( :id ) )
1416
15- resolve ( & SWAPIWeb.GraphQL.Resolvers. FilmResolver. one / 2 )
17+ resolve ( & FilmResolver . one / 2 )
1618 end
1719
1820 @ desc "Search films by title."
1921 field :search_films , list_of ( :film ) do
2022 @ desc "A list of search terms. If multiple search terms are used then objects will be returned in the list only if all the provided terms are matched."
2123 arg ( :search_terms , non_null ( list_of ( non_null ( :string ) ) ) )
2224
23- resolve ( & SWAPIWeb.GraphQL.Resolvers. FilmResolver. search / 2 )
25+ resolve ( & FilmResolver . search / 2 )
2426 end
2527 end
2628end
Original file line number Diff line number Diff line change 11defmodule SWAPIWeb.GraphQL.Queries.PersonQueries do
22 use Absinthe.Schema.Notation
33
4+ alias SWAPIWeb.GraphQL.Resolvers.PersonResolver
5+
46 object :person_queries do
57 @ desc "Get all people."
68 field :all_people , list_of ( :person ) do
7- resolve ( & SWAPIWeb.GraphQL.Resolvers. PersonResolver. all / 2 )
9+ resolve ( & PersonResolver . all / 2 )
810 end
911
1012 @ desc "Get a person by ID."
1113 field :person , :person do
1214 @ desc "The ID of the person."
1315 arg ( :id , non_null ( :id ) )
1416
15- resolve ( & SWAPIWeb.GraphQL.Resolvers. PersonResolver. one / 2 )
17+ resolve ( & PersonResolver . one / 2 )
1618 end
1719
1820 @ desc "Search people by name."
1921 field :search_people , list_of ( :person ) do
2022 @ desc "A list of search terms. If multiple search terms are used then objects will be returned in the list only if all the provided terms are matched."
2123 arg ( :search_terms , non_null ( list_of ( non_null ( :string ) ) ) )
2224
23- resolve ( & SWAPIWeb.GraphQL.Resolvers. PersonResolver. search / 2 )
25+ resolve ( & PersonResolver . search / 2 )
2426 end
2527 end
2628end
Original file line number Diff line number Diff line change 11defmodule SWAPIWeb.GraphQL.Queries.PlanetQueries do
22 use Absinthe.Schema.Notation
33
4+ alias SWAPIWeb.GraphQL.Resolvers.PlanetResolver
5+
46 object :planet_queries do
57 @ desc "Get all planets."
68 field :all_planets , list_of ( :planet ) do
7- resolve ( & SWAPIWeb.GraphQL.Resolvers. PlanetResolver. all / 2 )
9+ resolve ( & PlanetResolver . all / 2 )
810 end
911
1012 @ desc "Get a planet by ID."
1113 field :planet , :planet do
1214 @ desc "The ID of the planet."
1315 arg ( :id , non_null ( :id ) )
1416
15- resolve ( & SWAPIWeb.GraphQL.Resolvers. PlanetResolver. one / 2 )
17+ resolve ( & PlanetResolver . one / 2 )
1618 end
1719
1820 @ desc "Search planets by name."
1921 field :search_planets , list_of ( :planet ) do
2022 @ desc "A list of search terms. If multiple search terms are used then objects will be returned in the list only if all the provided terms are matched."
2123 arg ( :search_terms , non_null ( list_of ( non_null ( :string ) ) ) )
2224
23- resolve ( & SWAPIWeb.GraphQL.Resolvers. PlanetResolver. search / 2 )
25+ resolve ( & PlanetResolver . search / 2 )
2426 end
2527 end
2628end
Original file line number Diff line number Diff line change 11defmodule SWAPIWeb.GraphQL.Queries.SpeciesQueries do
22 use Absinthe.Schema.Notation
33
4+ alias SWAPIWeb.GraphQL.Resolvers.SpeciesResolver
5+
46 object :species_queries do
57 @ desc "Get all species."
68 field :all_species , list_of ( :species ) do
7- resolve ( & SWAPIWeb.GraphQL.Resolvers. SpeciesResolver. all / 2 )
9+ resolve ( & SpeciesResolver . all / 2 )
810 end
911
1012 @ desc "Get a species by ID."
1113 field :species , :species do
1214 @ desc "The ID of the species."
1315 arg ( :id , non_null ( :id ) )
1416
15- resolve ( & SWAPIWeb.GraphQL.Resolvers. SpeciesResolver. one / 2 )
17+ resolve ( & SpeciesResolver . one / 2 )
1618 end
1719
1820 @ desc "Search species by name."
1921 field :search_species , list_of ( :species ) do
2022 @ desc "A list of search terms. If multiple search terms are used then objects will be returned in the list only if all the provided terms are matched."
2123 arg ( :search_terms , non_null ( list_of ( non_null ( :string ) ) ) )
2224
23- resolve ( & SWAPIWeb.GraphQL.Resolvers. SpeciesResolver. search / 2 )
25+ resolve ( & SpeciesResolver . search / 2 )
2426 end
2527 end
2628end
Original file line number Diff line number Diff line change 11defmodule SWAPIWeb.GraphQL.Queries.StarshipQueries do
22 use Absinthe.Schema.Notation
33
4+ alias SWAPIWeb.GraphQL.Resolvers.StarshipResolver
5+
46 object :starship_queries do
57 @ desc "Get all starships."
68 field :all_starships , list_of ( :starship ) do
7- resolve ( & SWAPIWeb.GraphQL.Resolvers. StarshipResolver. all / 2 )
9+ resolve ( & StarshipResolver . all / 2 )
810 end
911
1012 @ desc "Get a starship by ID."
1113 field :starship , :starship do
1214 @ desc "The ID of the starship."
1315 arg ( :id , non_null ( :id ) )
1416
15- resolve ( & SWAPIWeb.GraphQL.Resolvers. StarshipResolver. one / 2 )
17+ resolve ( & StarshipResolver . one / 2 )
1618 end
1719
1820 @ desc "Search starships by name or model."
1921 field :search_starships , list_of ( :starship ) do
2022 @ desc "A list of search terms. If multiple search terms are used then objects will be returned in the list only if all the provided terms are matched."
2123 arg ( :search_terms , non_null ( list_of ( non_null ( :string ) ) ) )
2224
23- resolve ( & SWAPIWeb.GraphQL.Resolvers. StarshipResolver. search / 2 )
25+ resolve ( & StarshipResolver . search / 2 )
2426 end
2527 end
2628end
Original file line number Diff line number Diff line change 11defmodule SWAPIWeb.GraphQL.Queries.VehicleQueries do
22 use Absinthe.Schema.Notation
33
4+ alias SWAPIWeb.GraphQL.Resolvers.VehicleResolver
5+
46 object :vehicle_queries do
57 @ desc "Get all vehicles."
68 field :all_vehicles , list_of ( :vehicle ) do
7- resolve ( & SWAPIWeb.GraphQL.Resolvers. VehicleResolver. all / 2 )
9+ resolve ( & VehicleResolver . all / 2 )
810 end
911
1012 @ desc "Get a vehicle by ID."
1113 field :vehicle , :vehicle do
1214 @ desc "The ID of the vehicle."
1315 arg ( :id , non_null ( :id ) )
1416
15- resolve ( & SWAPIWeb.GraphQL.Resolvers. VehicleResolver. one / 2 )
17+ resolve ( & VehicleResolver . one / 2 )
1618 end
1719
1820 @ desc "Search vehicles by name or model."
1921 field :search_vehicles , list_of ( :vehicle ) do
2022 @ desc "A list of search terms. If multiple search terms are used then objects will be returned in the list only if all the provided terms are matched."
2123 arg ( :search_terms , non_null ( list_of ( non_null ( :string ) ) ) )
2224
23- resolve ( & SWAPIWeb.GraphQL.Resolvers. VehicleResolver. search / 2 )
25+ resolve ( & VehicleResolver . search / 2 )
2426 end
2527 end
2628end
You can’t perform that action at this time.
0 commit comments