From afc0df12918c2fd76979c551a5430402be01e9b7 Mon Sep 17 00:00:00 2001 From: Martin Fenner Date: Mon, 13 May 2019 11:52:54 +0200 Subject: [PATCH] Wrong method names. #258 --- app/graphql/types/client_type.rb | 2 +- app/graphql/types/funder_dataset_connection_with_meta_type.rb | 2 +- .../types/funder_publication_connection_with_meta_type.rb | 2 +- app/graphql/types/funder_software_connection_with_meta_type.rb | 2 +- .../types/researcher_dataset_connection_with_meta_type.rb | 2 +- .../types/researcher_publication_connection_with_meta_type.rb | 2 +- .../types/researcher_software_connection_with_meta_type.rb | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-) diff --git a/app/graphql/types/client_type.rb b/app/graphql/types/client_type.rb index 3baa6588f..8ba476650 100644 --- a/app/graphql/types/client_type.rb +++ b/app/graphql/types/client_type.rb @@ -27,7 +27,7 @@ class ClientType < GraphQL::Schema::Object argument :first, Int, required: false, default_value: 25 end - field :publications, ClientSoftwareConnectionWithMetaType, null: false, connection: true, max_page_size: 100, null: false, description: "Software managed by the client" do + field :softwares, ClientSoftwareConnectionWithMetaType, null: false, connection: true, max_page_size: 100, null: false, description: "Software managed by the client" do argument :query, String, required: false argument :first, Int, required: false, default_value: 25 end 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 fe85f3465..0cb510510 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").fetch(:meta, "total") + Event.query(nil, obj_id: object[: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 184536192..36d6d8cb3 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").fetch(:meta, "total") + Event.query(nil, obj_id: object[: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 bdec53250..382c4ad1e 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").fetch(:meta, "total") + Event.query(nil, obj_id: object[:id], citation_type: "Funder-SoftwareSourceCode").dig(:meta, "total").to_i end end diff --git a/app/graphql/types/researcher_dataset_connection_with_meta_type.rb b/app/graphql/types/researcher_dataset_connection_with_meta_type.rb index 9526b573a..f43f96366 100644 --- a/app/graphql/types/researcher_dataset_connection_with_meta_type.rb +++ b/app/graphql/types/researcher_dataset_connection_with_meta_type.rb @@ -6,7 +6,7 @@ class ResearcherDatasetConnectionWithMetaType < GraphQL::Types::Relay::BaseConne field :total_count, Integer, null: false def total_count - Event.query(nil, obj_id: https_to_http(object[:id]), citation_type: "Dataset-Person").fetch(:meta, "total") + Event.query(nil, obj_id: https_to_http(object[:id]), citation_type: "Dataset-Person").dig(:meta, "total").to_i end def https_to_http(url) diff --git a/app/graphql/types/researcher_publication_connection_with_meta_type.rb b/app/graphql/types/researcher_publication_connection_with_meta_type.rb index 984efecaa..e848aeaf5 100644 --- a/app/graphql/types/researcher_publication_connection_with_meta_type.rb +++ b/app/graphql/types/researcher_publication_connection_with_meta_type.rb @@ -6,7 +6,7 @@ class ResearcherPublicationConnectionWithMetaType < GraphQL::Types::Relay::BaseC field :total_count, Integer, null: false def total_count - Event.query(nil, obj_id: https_to_http(object[:id]), citation_type: "JournalArticle-Person").fetch(:meta, "total") + Event.query(nil, obj_id: https_to_http(object[:id]), citation_type: "JournalArticle-Person").dig(:meta, "total").to_i end def https_to_http(url) diff --git a/app/graphql/types/researcher_software_connection_with_meta_type.rb b/app/graphql/types/researcher_software_connection_with_meta_type.rb index 500e8231f..d1d64c93e 100644 --- a/app/graphql/types/researcher_software_connection_with_meta_type.rb +++ b/app/graphql/types/researcher_software_connection_with_meta_type.rb @@ -6,7 +6,7 @@ class ResearcherSoftwareConnectionWithMetaType < GraphQL::Types::Relay::BaseConn field :total_count, Integer, null: false def total_count - Event.query(nil, obj_id: https_to_http(object[:id]), citation_type: "Person-SoftwareSourceCode").fetch(:meta, "total") + Event.query(nil, obj_id: https_to_http(object[:id]), citation_type: "Person-SoftwareSourceCode").dig(:meta, "total").to_i end def https_to_http(url)