From 560c4652cfe2aadae5bd85734fa304f35678f946 Mon Sep 17 00:00:00 2001 From: Christian Joudrey Date: Sun, 12 Feb 2017 16:09:27 -0500 Subject: [PATCH] Rename collection fields for consistency --- app/models/graph/types/query.rb | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/app/models/graph/types/query.rb b/app/models/graph/types/query.rb index 926777a..3e4309e 100644 --- a/app/models/graph/types/query.rb +++ b/app/models/graph/types/query.rb @@ -4,39 +4,39 @@ module Types name "Query" description "The query root of this schema" - # Relay - field :node, GraphQL::Relay::Node.field - field :nodes, GraphQL::Relay::Node.plural_field - field :person, Graph.find_by_id_field(Graph::Types::Person, ::Person) - field :people, types[Graph::Types::Person] do + field :allPeople, !types[!Person] do resolve ->(_, _, _) { ::Person.all } end field :planet, Graph.find_by_id_field(Graph::Types::Planet, ::Planet) - field :planets, types[Graph::Types::Planet] do + field :allPlanets, !types[!Planet] do resolve ->(_, _, _) { ::Planet.all } end field :film, Graph.find_by_id_field(Graph::Types::Film, ::Film) - field :films, types[Graph::Types::Film] do + field :allFilms, !types[!Film] do resolve ->(_, _, _) { ::Film.all } end field :species, Graph.find_by_id_field(Graph::Types::Species, ::Species) - field :allSpecies, types[Graph::Types::Species] do + field :allSpecies, !types[!Species] do resolve ->(_, _, _) { ::Species.all } end field :starship, Graph.find_by_id_field(Graph::Types::Starship, ::Starship) - field :starships, types[Graph::Types::Starship] do + field :allStarships, !types[!Starship] do resolve ->(_, _, _) { ::Starship.all } end field :vehicle, Graph.find_by_id_field(Graph::Types::Vehicle, ::Vehicle) - field :vehicles, types[Graph::Types::Vehicle] do + field :allVehicles, !types[!Vehicle] do resolve ->(_, _, _) { ::Vehicle.all } end + + # Relay + field :node, GraphQL::Relay::Node.field + field :nodes, GraphQL::Relay::Node.plural_field end end end