Skip to content
This repository was archived by the owner on Sep 24, 2019. It is now read-only.

Commit 019fa99

Browse files
authored
Merge pull request #28 from GraphQLAcademy/rename-collection-fields
Rename collection fields for consistency
2 parents 0f640c1 + 560c465 commit 019fa99

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

app/models/graph/types/query.rb

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,39 +4,39 @@ module Types
44
name "Query"
55
description "The query root of this schema"
66

7-
# Relay
8-
field :node, GraphQL::Relay::Node.field
9-
field :nodes, GraphQL::Relay::Node.plural_field
10-
117
field :person, Graph.find_by_id_field(Graph::Types::Person, ::Person)
12-
field :people, types[Graph::Types::Person] do
8+
field :allPeople, !types[!Person] do
139
resolve ->(_, _, _) { ::Person.all }
1410
end
1511

1612
field :planet, Graph.find_by_id_field(Graph::Types::Planet, ::Planet)
17-
field :planets, types[Graph::Types::Planet] do
13+
field :allPlanets, !types[!Planet] do
1814
resolve ->(_, _, _) { ::Planet.all }
1915
end
2016

2117
field :film, Graph.find_by_id_field(Graph::Types::Film, ::Film)
22-
field :films, types[Graph::Types::Film] do
18+
field :allFilms, !types[!Film] do
2319
resolve ->(_, _, _) { ::Film.all }
2420
end
2521

2622
field :species, Graph.find_by_id_field(Graph::Types::Species, ::Species)
27-
field :allSpecies, types[Graph::Types::Species] do
23+
field :allSpecies, !types[!Species] do
2824
resolve ->(_, _, _) { ::Species.all }
2925
end
3026

3127
field :starship, Graph.find_by_id_field(Graph::Types::Starship, ::Starship)
32-
field :starships, types[Graph::Types::Starship] do
28+
field :allStarships, !types[!Starship] do
3329
resolve ->(_, _, _) { ::Starship.all }
3430
end
3531

3632
field :vehicle, Graph.find_by_id_field(Graph::Types::Vehicle, ::Vehicle)
37-
field :vehicles, types[Graph::Types::Vehicle] do
33+
field :allVehicles, !types[!Vehicle] do
3834
resolve ->(_, _, _) { ::Vehicle.all }
3935
end
36+
37+
# Relay
38+
field :node, GraphQL::Relay::Node.field
39+
field :nodes, GraphQL::Relay::Node.plural_field
4040
end
4141
end
4242
end

0 commit comments

Comments
 (0)