Skip to content

Commit

Permalink
published facet
Browse files Browse the repository at this point in the history
  • Loading branch information
kjgarza committed Jan 3, 2020
1 parent 50168e1 commit 745a967
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
2 changes: 2 additions & 0 deletions app/controllers/dois_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,7 @@ def index
else
states = total > 0 ? facet_by_key(response.aggregations.states.buckets) : nil
resource_types = total > 0 ? facet_by_resource_type(response.aggregations.resource_types.buckets) : nil
years = total > 0 ? facet_by_year(response.aggregations.years.buckets) : nil
created = total > 0 ? facet_by_year(response.aggregations.created.buckets) : nil
registered = total > 0 ? facet_by_year(response.aggregations.registered.buckets) : nil
providers = total > 0 ? facet_by_provider(response.aggregations.providers.buckets) : nil
Expand Down Expand Up @@ -167,6 +168,7 @@ def index
states: states,
"resourceTypes" => resource_types,
created: created,
published: years,
registered: registered,
providers: providers,
clients: clients,
Expand Down
7 changes: 3 additions & 4 deletions app/graphql/types/person_type.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ class PersonType < BaseObject
field :name, String, null: true, description: "The name of the person."
field :given_name, String, null: true, hash_key: "given_names", description: "Given name. In the U.S., the first name of a Person."
field :family_name, String, null: true, description: "Family name. In the U.S., the last name of an Person."
field :view_count, Integer, null: true, description: "The count of DOI views according to the COUNTER code of Practice"
field :download_count, Integer, null: true, description: "The count of DOI dowloands according to the COUNTER code of Practice"
field :citation_count, Integer, null: true, description: "The count of DOI events that represents citations"

field :datasets, PersonDatasetConnectionWithMetaType, null: true, description: "Authored datasets", connection: true do
argument :first, Int, required: false, default_value: 25
Expand All @@ -21,10 +24,6 @@ class PersonType < BaseObject
argument :first, Int, required: false, default_value: 25
end

field :view_count, Integer, null: true, description: "The count of DOI views according to the COUNTER code of Practice"
field :download_count, Integer, null: true, description: "The count of DOI dowloands according to the COUNTER code of Practice"
field :citation_count, Integer, null: true, description: "The count of DOI events that represents citations"

def type
"Person"
end
Expand Down

0 comments on commit 745a967

Please sign in to comment.