diff --git a/app/graphql/types/funder_dataset_connection_with_meta_type.rb b/app/graphql/types/funder_dataset_connection_with_meta_type.rb index 0cb510510..0473a2e13 100644 --- a/app/graphql/types/funder_dataset_connection_with_meta_type.rb +++ b/app/graphql/types/funder_dataset_connection_with_meta_type.rb @@ -6,6 +6,6 @@ class FunderDatasetConnectionWithMetaType < GraphQL::Types::Relay::BaseConnectio field :total_count, Integer, null: false def total_count - Event.query(nil, obj_id: object[:id], citation_type: "Dataset-Funder").dig(:meta, "total").to_i + Event.query(nil, obj_id: object.parent[:id], citation_type: "Dataset-Funder").dig(:meta, "total").to_i end end diff --git a/app/graphql/types/funder_publication_connection_with_meta_type.rb b/app/graphql/types/funder_publication_connection_with_meta_type.rb index 36d6d8cb3..6b9fc501c 100644 --- a/app/graphql/types/funder_publication_connection_with_meta_type.rb +++ b/app/graphql/types/funder_publication_connection_with_meta_type.rb @@ -6,6 +6,6 @@ class FunderPublicationConnectionWithMetaType < GraphQL::Types::Relay::BaseConne field :total_count, Integer, null: false def total_count - Event.query(nil, obj_id: object[:id], citation_type: "Funder-JournalArticle").dig(:meta, "total").to_i + Event.query(nil, obj_id: object.parent[:id], citation_type: "Funder-JournalArticle").dig(:meta, "total").to_i end end diff --git a/app/graphql/types/funder_software_connection_with_meta_type.rb b/app/graphql/types/funder_software_connection_with_meta_type.rb index 382c4ad1e..1723f7b60 100644 --- a/app/graphql/types/funder_software_connection_with_meta_type.rb +++ b/app/graphql/types/funder_software_connection_with_meta_type.rb @@ -6,6 +6,6 @@ class FunderSoftwareConnectionWithMetaType < GraphQL::Types::Relay::BaseConnecti field :total_count, Integer, null: false def total_count - Event.query(nil, obj_id: object[:id], citation_type: "Funder-SoftwareSourceCode").dig(:meta, "total").to_i + Event.query(nil, obj_id: object.parent[:id], citation_type: "Funder-SoftwareSourceCode").dig(:meta, "total").to_i end end