diff --git a/app/graphql/types/query_type.rb b/app/graphql/types/query_type.rb index 3fe3124b7..8e88ec927 100644 --- a/app/graphql/types/query_type.rb +++ b/app/graphql/types/query_type.rb @@ -271,6 +271,8 @@ def actor(id:) argument :has_views, Int, required: false argument :has_downloads, Int, required: false argument :field_of_science, String, required: false + argument :field_of_science_repository, String, required: false + argument :field_of_science_combined, String, required: false argument :facet_count, Int, required: false, default_value: 10 argument :first, Int, required: false, default_value: 25 argument :after, String, required: false @@ -1281,6 +1283,8 @@ def response(**args) has_views: args[:has_views], has_downloads: args[:has_downloads], field_of_science: args[:field_of_science], + field_of_science_repository: args[:field_of_science_repository], + field_of_science_combined: args[:field_of_science_combined], facet_count: args[:facet_count], pid_entity: args[:pid_entity], state: "findable", diff --git a/spec/graphql/types/work_type_spec.rb b/spec/graphql/types/work_type_spec.rb index 296b809db..6f5473628 100644 --- a/spec/graphql/types/work_type_spec.rb +++ b/spec/graphql/types/work_type_spec.rb @@ -1270,19 +1270,18 @@ ).to match_array([]) end - # Temporariliy disable these tests until gql/aggregates are enabled - # it "returns Field of Science Facets from the repository" do - # response = @facet_response - # expect( - # response.dig("data", "works", "fieldsOfScienceRepository") - # ).to match_array([ fos_facet ]) - # end - - # it "returns combined Field of Science Facets" do - # response = @facet_response - # expect( - # response.dig("data", "works", "fieldsOfScienceCombined") - # ).to match_array([ fos_facet ]) - # end + it "returns Field of Science Facets from the repository" do + response = @facet_response + expect( + response.dig("data", "works", "fieldsOfScienceRepository") + ).to match_array([ fos_facet ]) + end + + it "returns combined Field of Science Facets" do + response = @facet_response + expect( + response.dig("data", "works", "fieldsOfScienceCombined") + ).to match_array([ fos_facet ]) + end end end