Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/datacite/lupo
Browse files Browse the repository at this point in the history
  • Loading branch information
Martin Fenner committed Jun 24, 2021
2 parents 97f37a0 + 6dcd8f9 commit 251c79b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
5 changes: 5 additions & 0 deletions app/graphql/types/work_connection_with_total_type.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ class WorkConnectionWithTotalType < BaseConnection
field :total_count, Integer, null: false, cache: true
field :totalCountFromCrossref,
resolver: TotalCountFromCrossref, null: true, cache: true
field :total_content_url, Integer, null: true, cache: true
field :published, [FacetType], null: true, cache: true
field :resource_types, [FacetType], null: true, cache: true
field :registration_agencies, [FacetType], null: true, cache: true
Expand All @@ -21,6 +22,10 @@ def total_count
object.total_count
end

def total_content_url
object.aggregations.content_url_count.value.to_i
end

def published
if object.aggregations.published
facet_by_range(object.aggregations.published.buckets)
Expand Down
1 change: 1 addition & 0 deletions app/models/doi.rb
Original file line number Diff line number Diff line change
Expand Up @@ -633,6 +633,7 @@ def self.gql_query_aggregations(facet_count: 10)
view_count: { sum: { field: "view_count" } },
download_count: { sum: { field: "download_count" } },
citation_count: { sum: { field: "citation_count" } },
content_url_count: { value_count: { field: "content_url" } },
}
end
end
Expand Down

0 comments on commit 251c79b

Please sign in to comment.