Skip to content

Commit

Permalink
remove duplicate funder fields
Browse files Browse the repository at this point in the history
  • Loading branch information
Martin Fenner committed Oct 4, 2019
1 parent 6f0501e commit f08f855
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 12 deletions.
7 changes: 0 additions & 7 deletions app/graphql/types/funder_connection_with_meta_type.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,9 @@ class FunderConnectionWithMetaType < BaseConnection
edge_type(FunderEdgeType)
field_class GraphQL::Cache::Field

field :total_count, Integer, null: false, cache: true
field :publication_connection_count, Integer, null: false, cache: true
field :dataset_connection_count, Integer, null: false, cache: true
field :software_connection_count, Integer, null: false, cache: true

def total_count
args = object.arguments

Funder.query(args[:query], limit: 0).dig(:meta, "total").to_i
end

def publication_connection_count
Event.query(nil, citation_type: "Funder-ScholarlyArticle").results.total
Expand Down
5 changes: 0 additions & 5 deletions app/graphql/types/funder_type.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,6 @@
class FunderType < BaseObject
description "Information about funders"

field :id, ID, null: false, description: "Crossref Funder ID"
field :name, String, null: false, description: "The name of the funder."
field :alternate_name, [String], null: true, description: "An alias for the funder."
field :address, AddressType, null: true, description: "Physical address of the funder."

field :datasets, FunderDatasetConnectionWithMetaType, null: false, description: "Funded datasets", connection: true, max_page_size: 100 do
argument :first, Int, required: false, default_value: 25
end
Expand Down

0 comments on commit f08f855

Please sign in to comment.