diff --git a/app/graphql/schema.graphql b/app/graphql/schema.graphql index 5083210b6..4d97a2585 100644 --- a/app/graphql/schema.graphql +++ b/app/graphql/schema.graphql @@ -4962,6 +4962,26 @@ type InteractiveResourceEdge { node: InteractiveResource } +""" +Information about ISSN +""" +type Issn { + """ + The electronic ISSN + """ + electronic: String + + """ + The ISSNL + """ + issnl: String + + """ + The print ISSN + """ + print: String +} + """ Information about providers """ @@ -8359,11 +8379,21 @@ type Repository { """ alternateName: String + """ + The certificate(s) for the repository + """ + certificate: [String!] + """ The number of citations. """ citationCount: Int + """ + The client type (repository or periodical) + """ + clientType: String + """ Datasets managed by the repository """ @@ -8416,6 +8446,16 @@ type Repository { """ id: ID! + """ + The ISSN + """ + issn: Issn + + """ + The langauge of the repository + """ + language: [String!] + """ Repository name """ @@ -8487,6 +8527,11 @@ type Repository { """ re3data: ID + """ + The repository type(s) + """ + repositoryType: [String!] + """ The name of the software that is used to run the repository """ diff --git a/app/graphql/types/issn_type.rb b/app/graphql/types/issn_type.rb new file mode 100644 index 000000000..c6e13ad84 --- /dev/null +++ b/app/graphql/types/issn_type.rb @@ -0,0 +1,9 @@ +# frozen_string_literal: true + +class IssnType < BaseObject + description "Information about ISSN" + + field :issnl, String, null: true, description: "The ISSNL" + field :electronic, String, null: true, description: "The electronic ISSN" + field :print, String, null: true, description: "The print ISSN" +end diff --git a/app/graphql/types/repository_type.rb b/app/graphql/types/repository_type.rb index ab36993dc..ef626b973 100644 --- a/app/graphql/types/repository_type.rb +++ b/app/graphql/types/repository_type.rb @@ -5,12 +5,18 @@ class RepositoryType < BaseObject field :id, ID, null: false, hash_key: "uid", description: "Unique identifier for each repository" field :type, String, null: false, description: "The type of the item." + field :re3data, ID, null: true, description: "The re3data identifier for the repository" field :name, String, null: false, description: "Repository name" field :alternate_name, String, null: true, description: "Repository alternate name" - field :re3data, ID, null: true, description: "The re3data identifier for the repository" field :description, String, null: true, description: "Description of the repository" field :url, Url, null: true, description: "The homepage of the repository" field :software, String, null: true, description: "The name of the software that is used to run the repository" + field :client_type, String, null: true, description: "The client type (repository or periodical)" + field :repository_type, [String], null: true, description: "The repository type(s)" + field :certificate, [String], null: true, description: "The certificate(s) for the repository" + field :language, [String], null: true, description: "The langauge of the repository" + field :issn, IssnType, null: true, description: "The ISSN" + field :view_count, Integer, null: true, description: "The number of views according to the Counter Code of Practice." field :download_count, Integer, null: true, description: "The number of downloads according to the Counter Code of Practice." field :citation_count, Integer, null: true, description: "The number of citations." diff --git a/spec/graphql/types/issn_type_spec.rb b/spec/graphql/types/issn_type_spec.rb new file mode 100644 index 000000000..32f13ec78 --- /dev/null +++ b/spec/graphql/types/issn_type_spec.rb @@ -0,0 +1,11 @@ +require "rails_helper" + +describe IssnType do + describe "fields" do + subject { described_class } + + it { is_expected.to have_field(:issnl).of_type("String") } + it { is_expected.to have_field(:electronic).of_type("String") } + it { is_expected.to have_field(:print).of_type("String") } + end +end diff --git a/spec/graphql/types/repository_type_spec.rb b/spec/graphql/types/repository_type_spec.rb index 867c38129..d42c4a210 100644 --- a/spec/graphql/types/repository_type_spec.rb +++ b/spec/graphql/types/repository_type_spec.rb @@ -6,9 +6,18 @@ it { is_expected.to have_field(:id).of_type(!types.ID) } it { is_expected.to have_field(:type).of_type("String!") } + it { is_expected.to have_field(:re3data).of_type(types.ID) } it { is_expected.to have_field(:name).of_type("String!") } it { is_expected.to have_field(:alternateName).of_type("String") } it { is_expected.to have_field(:description).of_type("String") } + it { is_expected.to have_field(:url).of_type("Url") } + it { is_expected.to have_field(:software).of_type("String") } + it { is_expected.to have_field(:clientType).of_type("String") } + it { is_expected.to have_field(:repositoryType).of_type("[String!]") } + it { is_expected.to have_field(:certificate).of_type("[String!]") } + it { is_expected.to have_field(:language).of_type("[String!]") } + it { is_expected.to have_field(:issn).of_type("Issn") } + it { is_expected.to have_field(:datasets).of_type("DatasetConnection") } it { is_expected.to have_field(:publications).of_type("PublicationConnection") } it { is_expected.to have_field(:softwares).of_type("SoftwareConnection") }