diff --git a/app/graphql/schema.graphql b/app/graphql/schema.graphql index a917b04ad..fa22e5ea8 100644 --- a/app/graphql/schema.graphql +++ b/app/graphql/schema.graphql @@ -436,6 +436,7 @@ type AudiovisualConnectionWithTotal implements WorkFacetsInterface { published: [Facet!] registrationAgencies: [Facet!] repositories: [Facet!] + repositoryTypes: [Facet!] totalCount: Int! } @@ -1075,6 +1076,7 @@ type BookChapterConnectionWithTotal implements WorkFacetsInterface { published: [Facet!] registrationAgencies: [Facet!] repositories: [Facet!] + repositoryTypes: [Facet!] totalCount: Int! } @@ -1126,6 +1128,7 @@ type BookConnectionWithTotal implements WorkFacetsInterface { published: [Facet!] registrationAgencies: [Facet!] repositories: [Facet!] + repositoryTypes: [Facet!] totalCount: Int! } @@ -1519,6 +1522,7 @@ type CollectionConnectionWithTotal implements WorkFacetsInterface { published: [Facet!] registrationAgencies: [Facet!] repositories: [Facet!] + repositoryTypes: [Facet!] totalCount: Int! } @@ -1864,6 +1868,7 @@ type ConferencePaperConnectionWithTotal implements WorkFacetsInterface { published: [Facet!] registrationAgencies: [Facet!] repositories: [Facet!] + repositoryTypes: [Facet!] totalCount: Int! } @@ -2501,6 +2506,7 @@ type DataManagementPlanConnectionWithTotal implements WorkFacetsInterface { published: [Facet!] registrationAgencies: [Facet!] repositories: [Facet!] + repositoryTypes: [Facet!] totalCount: Int! } @@ -2846,6 +2852,7 @@ type DataPaperConnectionWithTotal implements WorkFacetsInterface { published: [Facet!] registrationAgencies: [Facet!] repositories: [Facet!] + repositoryTypes: [Facet!] totalCount: Int! } @@ -3217,6 +3224,7 @@ type DatasetConnectionWithTotal implements WorkFacetsInterface { published: [Facet!] registrationAgencies: [Facet!] repositories: [Facet!] + repositoryTypes: [Facet!] softwareConnectionCount: Int! totalCount: Int! } @@ -3654,6 +3662,7 @@ type DissertationConnectionWithTotal implements WorkFacetsInterface { published: [Facet!] registrationAgencies: [Facet!] repositories: [Facet!] + repositoryTypes: [Facet!] totalCount: Int! } @@ -5288,6 +5297,7 @@ type ImageConnectionWithTotal implements WorkFacetsInterface { published: [Facet!] registrationAgencies: [Facet!] repositories: [Facet!] + repositoryTypes: [Facet!] totalCount: Int! } @@ -5633,6 +5643,7 @@ type InstrumentConnectionWithTotal implements WorkFacetsInterface { published: [Facet!] registrationAgencies: [Facet!] repositories: [Facet!] + repositoryTypes: [Facet!] totalCount: Int! } @@ -5978,6 +5989,7 @@ type InteractiveResourceConnectionWithTotal implements WorkFacetsInterface { published: [Facet!] registrationAgencies: [Facet!] repositories: [Facet!] + repositoryTypes: [Facet!] totalCount: Int! } @@ -6328,6 +6340,7 @@ type JournalArticleConnectionWithTotal implements WorkFacetsInterface { published: [Facet!] registrationAgencies: [Facet!] repositories: [Facet!] + repositoryTypes: [Facet!] totalCount: Int! } @@ -6969,6 +6982,7 @@ type ModelConnectionWithTotal implements WorkFacetsInterface { published: [Facet!] registrationAgencies: [Facet!] repositories: [Facet!] + repositoryTypes: [Facet!] totalCount: Int! } @@ -7511,6 +7525,7 @@ type OtherConnectionWithTotal implements WorkFacetsInterface { published: [Facet!] registrationAgencies: [Facet!] repositories: [Facet!] + repositoryTypes: [Facet!] totalCount: Int! } @@ -7881,6 +7896,7 @@ type PeerReviewConnectionWithTotal implements WorkFacetsInterface { published: [Facet!] registrationAgencies: [Facet!] repositories: [Facet!] + repositoryTypes: [Facet!] totalCount: Int! } @@ -8363,6 +8379,7 @@ type PhysicalObjectConnectionWithTotal implements WorkFacetsInterface { published: [Facet!] registrationAgencies: [Facet!] repositories: [Facet!] + repositoryTypes: [Facet!] totalCount: Int! } @@ -8761,6 +8778,7 @@ type PreprintConnectionWithTotal implements WorkFacetsInterface { published: [Facet!] registrationAgencies: [Facet!] repositories: [Facet!] + repositoryTypes: [Facet!] totalCount: Int! } @@ -9111,6 +9129,7 @@ type PublicationConnectionWithTotal implements WorkFacetsInterface { published: [Facet!] registrationAgencies: [Facet!] repositories: [Facet!] + repositoryTypes: [Facet!] softwareConnectionCount: Int! totalCount: Int! } @@ -9165,66 +9184,66 @@ type Query { actor(id: ID!): ActorItem! actors(after: String, first: Int = 25, query: String): ActorConnection! audiovisual(id: ID!): Audiovisual! - audiovisuals(after: String, facetCount: Int = 10, fieldOfScience: String, fieldOfScienceCombined: String, fieldOfScienceRepository: String, first: Int = 25, funderId: String, hasAffiliation: Boolean, hasCitations: Int, hasDownloads: Int, hasFunder: Boolean, hasMember: Boolean, hasOrganization: Boolean, hasParts: Int, hasPerson: Boolean, hasVersions: Int, hasViews: Int, ids: [String!], language: String, license: String, memberId: String, published: String, query: String, registrationAgency: String, repositoryId: String, userId: String): AudiovisualConnectionWithTotal! + audiovisuals(after: String, facetCount: Int = 10, fieldOfScience: String, fieldOfScienceCombined: String, fieldOfScienceRepository: String, first: Int = 25, funderId: String, hasAffiliation: Boolean, hasCitations: Int, hasDownloads: Int, hasFunder: Boolean, hasMember: Boolean, hasOrganization: Boolean, hasParts: Int, hasPerson: Boolean, hasVersions: Int, hasViews: Int, ids: [String!], language: String, license: String, memberId: String, published: String, query: String, registrationAgency: String, repositoryId: String, repositoryType: String, userId: String): AudiovisualConnectionWithTotal! book(id: ID!): Book! bookChapter(id: ID!): BookChapter! - bookChapters(after: String, facetCount: Int = 10, fieldOfScience: String, fieldOfScienceCombined: String, fieldOfScienceRepository: String, first: Int = 25, funderId: String, hasAffiliation: Boolean, hasCitations: Int, hasDownloads: Int, hasFunder: Boolean, hasMember: Boolean, hasOrganization: Boolean, hasParts: Int, hasPerson: Boolean, hasVersions: Int, hasViews: Int, ids: [String!], language: String, license: String, memberId: String, published: String, query: String, registrationAgency: String, repositoryId: String, userId: String): BookChapterConnectionWithTotal! - books(after: String, facetCount: Int = 10, fieldOfScience: String, fieldOfScienceCombined: String, fieldOfScienceRepository: String, first: Int = 25, funderId: String, hasAffiliation: Boolean, hasCitations: Int, hasDownloads: Int, hasFunder: Boolean, hasMember: Boolean, hasOrganization: Boolean, hasParts: Int, hasPerson: Boolean, hasVersions: Int, hasViews: Int, ids: [String!], language: String, license: String, memberId: String, published: String, query: String, registrationAgency: String, repositoryId: String, userId: String): BookConnectionWithTotal! + bookChapters(after: String, facetCount: Int = 10, fieldOfScience: String, fieldOfScienceCombined: String, fieldOfScienceRepository: String, first: Int = 25, funderId: String, hasAffiliation: Boolean, hasCitations: Int, hasDownloads: Int, hasFunder: Boolean, hasMember: Boolean, hasOrganization: Boolean, hasParts: Int, hasPerson: Boolean, hasVersions: Int, hasViews: Int, ids: [String!], language: String, license: String, memberId: String, published: String, query: String, registrationAgency: String, repositoryId: String, repositoryType: String, userId: String): BookChapterConnectionWithTotal! + books(after: String, facetCount: Int = 10, fieldOfScience: String, fieldOfScienceCombined: String, fieldOfScienceRepository: String, first: Int = 25, funderId: String, hasAffiliation: Boolean, hasCitations: Int, hasDownloads: Int, hasFunder: Boolean, hasMember: Boolean, hasOrganization: Boolean, hasParts: Int, hasPerson: Boolean, hasVersions: Int, hasViews: Int, ids: [String!], language: String, license: String, memberId: String, published: String, query: String, registrationAgency: String, repositoryId: String, repositoryType: String, userId: String): BookConnectionWithTotal! collection(id: ID!): Collection! - collections(after: String, facetCount: Int = 10, fieldOfScience: String, fieldOfScienceCombined: String, fieldOfScienceRepository: String, first: Int = 25, funderId: String, hasAffiliation: Boolean, hasCitations: Int, hasDownloads: Int, hasFunder: Boolean, hasMember: Boolean, hasOrganization: Boolean, hasParts: Int, hasPerson: Boolean, hasVersions: Int, hasViews: Int, ids: [String!], language: String, license: String, memberId: String, published: String, query: String, registrationAgency: String, repositoryId: String, userId: String): CollectionConnectionWithTotal! + collections(after: String, facetCount: Int = 10, fieldOfScience: String, fieldOfScienceCombined: String, fieldOfScienceRepository: String, first: Int = 25, funderId: String, hasAffiliation: Boolean, hasCitations: Int, hasDownloads: Int, hasFunder: Boolean, hasMember: Boolean, hasOrganization: Boolean, hasParts: Int, hasPerson: Boolean, hasVersions: Int, hasViews: Int, ids: [String!], language: String, license: String, memberId: String, published: String, query: String, registrationAgency: String, repositoryId: String, repositoryType: String, userId: String): CollectionConnectionWithTotal! conferencePaper(id: ID!): ConferencePaper! - conferencePapers(after: String, facetCount: Int = 10, fieldOfScience: String, fieldOfScienceCombined: String, fieldOfScienceRepository: String, first: Int = 25, funderId: String, hasAffiliation: Boolean, hasCitations: Int, hasDownloads: Int, hasFunder: Boolean, hasMember: Boolean, hasOrganization: Boolean, hasParts: Int, hasPerson: Boolean, hasVersions: Int, hasViews: Int, ids: [String!], language: String, license: String, memberId: String, published: String, query: String, registrationAgency: String, repositoryId: String, userId: String): ConferencePaperConnectionWithTotal! + conferencePapers(after: String, facetCount: Int = 10, fieldOfScience: String, fieldOfScienceCombined: String, fieldOfScienceRepository: String, first: Int = 25, funderId: String, hasAffiliation: Boolean, hasCitations: Int, hasDownloads: Int, hasFunder: Boolean, hasMember: Boolean, hasOrganization: Boolean, hasParts: Int, hasPerson: Boolean, hasVersions: Int, hasViews: Int, ids: [String!], language: String, license: String, memberId: String, published: String, query: String, registrationAgency: String, repositoryId: String, repositoryType: String, userId: String): ConferencePaperConnectionWithTotal! dataCatalog(id: ID!): DataCatalog! dataCatalogs(after: String, certified: String, disciplinary: String, first: Int = 25, open: String, pid: String, query: String, software: String, subject: String): DataCatalogConnectionWithTotal! dataManagementPlan(id: ID!): DataManagementPlan! - dataManagementPlans(after: String, facetCount: Int = 10, fieldOfScience: String, fieldOfScienceCombined: String, fieldOfScienceRepository: String, first: Int = 25, funderId: String, hasAffiliation: Boolean, hasCitations: Int, hasDownloads: Int, hasFunder: Boolean, hasMember: Boolean, hasOrganization: Boolean, hasParts: Int, hasPerson: Boolean, hasVersions: Int, hasViews: Int, ids: [String!], language: String, license: String, memberId: String, published: String, query: String, registrationAgency: String, repositoryId: String, userId: String): DataManagementPlanConnectionWithTotal! + dataManagementPlans(after: String, facetCount: Int = 10, fieldOfScience: String, fieldOfScienceCombined: String, fieldOfScienceRepository: String, first: Int = 25, funderId: String, hasAffiliation: Boolean, hasCitations: Int, hasDownloads: Int, hasFunder: Boolean, hasMember: Boolean, hasOrganization: Boolean, hasParts: Int, hasPerson: Boolean, hasVersions: Int, hasViews: Int, ids: [String!], language: String, license: String, memberId: String, published: String, query: String, registrationAgency: String, repositoryId: String, repositoryType: String, userId: String): DataManagementPlanConnectionWithTotal! dataPaper(id: ID!): DataPaper! - dataPapers(after: String, facetCount: Int = 10, fieldOfScience: String, fieldOfScienceCombined: String, fieldOfScienceRepository: String, first: Int = 25, funderId: String, hasAffiliation: Boolean, hasCitations: Int, hasDownloads: Int, hasFunder: Boolean, hasMember: Boolean, hasOrganization: Boolean, hasParts: Int, hasPerson: Boolean, hasVersions: Int, hasViews: Int, ids: [String!], language: String, license: String, memberId: String, published: String, query: String, registrationAgency: String, repositoryId: String, userId: String): DataPaperConnectionWithTotal! + dataPapers(after: String, facetCount: Int = 10, fieldOfScience: String, fieldOfScienceCombined: String, fieldOfScienceRepository: String, first: Int = 25, funderId: String, hasAffiliation: Boolean, hasCitations: Int, hasDownloads: Int, hasFunder: Boolean, hasMember: Boolean, hasOrganization: Boolean, hasParts: Int, hasPerson: Boolean, hasVersions: Int, hasViews: Int, ids: [String!], language: String, license: String, memberId: String, published: String, query: String, registrationAgency: String, repositoryId: String, repositoryType: String, userId: String): DataPaperConnectionWithTotal! dataset(id: ID!): Dataset! - datasets(after: String, facetCount: Int = 10, fieldOfScience: String, fieldOfScienceCombined: String, fieldOfScienceRepository: String, first: Int = 25, funderId: String, hasAffiliation: Boolean, hasCitations: Int, hasDownloads: Int, hasFunder: Boolean, hasMember: Boolean, hasOrganization: Boolean, hasParts: Int, hasPerson: Boolean, hasVersions: Int, hasViews: Int, ids: [String!], language: String, license: String, memberId: String, published: String, query: String, registrationAgency: String, repositoryId: String, userId: String): DatasetConnectionWithTotal! + datasets(after: String, facetCount: Int = 10, fieldOfScience: String, fieldOfScienceCombined: String, fieldOfScienceRepository: String, first: Int = 25, funderId: String, hasAffiliation: Boolean, hasCitations: Int, hasDownloads: Int, hasFunder: Boolean, hasMember: Boolean, hasOrganization: Boolean, hasParts: Int, hasPerson: Boolean, hasVersions: Int, hasViews: Int, ids: [String!], language: String, license: String, memberId: String, published: String, query: String, registrationAgency: String, repositoryId: String, repositoryType: String, userId: String): DatasetConnectionWithTotal! dissertation(id: ID!): Dissertation! - dissertations(after: String, facetCount: Int = 10, fieldOfScience: String, fieldOfScienceCombined: String, fieldOfScienceRepository: String, first: Int = 25, funderId: String, hasAffiliation: Boolean, hasCitations: Int, hasDownloads: Int, hasFunder: Boolean, hasMember: Boolean, hasOrganization: Boolean, hasParts: Int, hasPerson: Boolean, hasVersions: Int, hasViews: Int, ids: [String!], language: String, license: String, memberId: String, published: String, query: String, registrationAgency: String, repositoryId: String, userId: String): DissertationConnectionWithTotal! + dissertations(after: String, facetCount: Int = 10, fieldOfScience: String, fieldOfScienceCombined: String, fieldOfScienceRepository: String, first: Int = 25, funderId: String, hasAffiliation: Boolean, hasCitations: Int, hasDownloads: Int, hasFunder: Boolean, hasMember: Boolean, hasOrganization: Boolean, hasParts: Int, hasPerson: Boolean, hasVersions: Int, hasViews: Int, ids: [String!], language: String, license: String, memberId: String, published: String, query: String, registrationAgency: String, repositoryId: String, repositoryType: String, userId: String): DissertationConnectionWithTotal! event(id: ID!): Event! - events(after: String, facetCount: Int = 10, fieldOfScience: String, first: Int = 25, hasAffiliation: Boolean, hasCitations: Int, hasDownloads: Int, hasFunder: Boolean, hasMember: Boolean, hasOrganization: Boolean, hasParts: Int, hasPerson: Boolean, hasVersions: Int, hasViews: Int, ids: [String!], language: String, license: String, memberId: String, published: String, query: String, registrationAgency: String, repositoryId: String, userId: String): EventConnectionWithTotal! + events(after: String, facetCount: Int = 10, fieldOfScience: String, first: Int = 25, hasAffiliation: Boolean, hasCitations: Int, hasDownloads: Int, hasFunder: Boolean, hasMember: Boolean, hasOrganization: Boolean, hasParts: Int, hasPerson: Boolean, hasVersions: Int, hasViews: Int, ids: [String!], language: String, license: String, memberId: String, published: String, query: String, registrationAgency: String, repositoryId: String, repositoryType: String, userId: String): EventConnectionWithTotal! funder(id: ID!): Funder! funders(after: String, first: Int = 25, query: String): FunderConnectionWithTotal! image(id: ID!): Image! - images(after: String, facetCount: Int = 10, fieldOfScience: String, fieldOfScienceCombined: String, fieldOfScienceRepository: String, first: Int = 25, funderId: String, hasAffiliation: Boolean, hasCitations: Int, hasDownloads: Int, hasFunder: Boolean, hasMember: Boolean, hasOrganization: Boolean, hasParts: Int, hasPerson: Boolean, hasVersions: Int, hasViews: Int, ids: [String!], language: String, license: String, memberId: String, published: String, query: String, registrationAgency: String, repositoryId: String, userId: String): ImageConnectionWithTotal! + images(after: String, facetCount: Int = 10, fieldOfScience: String, fieldOfScienceCombined: String, fieldOfScienceRepository: String, first: Int = 25, funderId: String, hasAffiliation: Boolean, hasCitations: Int, hasDownloads: Int, hasFunder: Boolean, hasMember: Boolean, hasOrganization: Boolean, hasParts: Int, hasPerson: Boolean, hasVersions: Int, hasViews: Int, ids: [String!], language: String, license: String, memberId: String, published: String, query: String, registrationAgency: String, repositoryId: String, repositoryType: String, userId: String): ImageConnectionWithTotal! instrument(id: ID!): Instrument! - instruments(after: String, facetCount: Int = 10, fieldOfScience: String, fieldOfScienceCombined: String, fieldOfScienceRepository: String, first: Int = 25, funderId: String, hasAffiliation: Boolean, hasCitations: Int, hasDownloads: Int, hasFunder: Boolean, hasMember: Boolean, hasOrganization: Boolean, hasParts: Int, hasPerson: Boolean, hasVersions: Int, hasViews: Int, ids: [String!], language: String, license: String, memberId: String, published: String, query: String, registrationAgency: String, repositoryId: String, userId: String): InstrumentConnectionWithTotal! + instruments(after: String, facetCount: Int = 10, fieldOfScience: String, fieldOfScienceCombined: String, fieldOfScienceRepository: String, first: Int = 25, funderId: String, hasAffiliation: Boolean, hasCitations: Int, hasDownloads: Int, hasFunder: Boolean, hasMember: Boolean, hasOrganization: Boolean, hasParts: Int, hasPerson: Boolean, hasVersions: Int, hasViews: Int, ids: [String!], language: String, license: String, memberId: String, published: String, query: String, registrationAgency: String, repositoryId: String, repositoryType: String, userId: String): InstrumentConnectionWithTotal! interactiveResource(id: ID!): InteractiveResource! - interactiveResources(after: String, facetCount: Int = 10, fieldOfScience: String, fieldOfScienceCombined: String, fieldOfScienceRepository: String, first: Int = 25, funderId: String, hasAffiliation: Boolean, hasCitations: Int, hasDownloads: Int, hasFunder: Boolean, hasMember: Boolean, hasOrganization: Boolean, hasParts: Int, hasPerson: Boolean, hasVersions: Int, hasViews: Int, ids: [String!], language: String, license: String, memberId: String, published: String, query: String, registrationAgency: String, repositoryId: String, userId: String): InteractiveResourceConnectionWithTotal! + interactiveResources(after: String, facetCount: Int = 10, fieldOfScience: String, fieldOfScienceCombined: String, fieldOfScienceRepository: String, first: Int = 25, funderId: String, hasAffiliation: Boolean, hasCitations: Int, hasDownloads: Int, hasFunder: Boolean, hasMember: Boolean, hasOrganization: Boolean, hasParts: Int, hasPerson: Boolean, hasVersions: Int, hasViews: Int, ids: [String!], language: String, license: String, memberId: String, published: String, query: String, registrationAgency: String, repositoryId: String, repositoryType: String, userId: String): InteractiveResourceConnectionWithTotal! journalArticle(id: ID!): JournalArticle! - journalArticles(after: String, facetCount: Int = 10, fieldOfScience: String, fieldOfScienceCombined: String, fieldOfScienceRepository: String, first: Int = 25, funderId: String, hasAffiliation: Boolean, hasCitations: Int, hasDownloads: Int, hasFunder: Boolean, hasMember: Boolean, hasOrganization: Boolean, hasParts: Int, hasPerson: Boolean, hasVersions: Int, hasViews: Int, ids: [String!], language: String, license: String, memberId: String, published: String, query: String, registrationAgency: String, repositoryId: String, userId: String): JournalArticleConnectionWithTotal! + journalArticles(after: String, facetCount: Int = 10, fieldOfScience: String, fieldOfScienceCombined: String, fieldOfScienceRepository: String, first: Int = 25, funderId: String, hasAffiliation: Boolean, hasCitations: Int, hasDownloads: Int, hasFunder: Boolean, hasMember: Boolean, hasOrganization: Boolean, hasParts: Int, hasPerson: Boolean, hasVersions: Int, hasViews: Int, ids: [String!], language: String, license: String, memberId: String, published: String, query: String, registrationAgency: String, repositoryId: String, repositoryType: String, userId: String): JournalArticleConnectionWithTotal! me: Me member(id: ID!): Member! members(after: String, first: Int = 25, query: String, year: String): MemberConnectionWithTotal! model(id: ID!): Model! - models(after: String, facetCount: Int = 10, fieldOfScience: String, fieldOfScienceCombined: String, fieldOfScienceRepository: String, first: Int = 25, funderId: String, hasAffiliation: Boolean, hasCitations: Int, hasDownloads: Int, hasFunder: Boolean, hasMember: Boolean, hasOrganization: Boolean, hasParts: Int, hasPerson: Boolean, hasVersions: Int, hasViews: Int, ids: [String!], language: String, license: String, memberId: String, published: String, query: String, registrationAgency: String, repositoryId: String, userId: String): ModelConnectionWithTotal! + models(after: String, facetCount: Int = 10, fieldOfScience: String, fieldOfScienceCombined: String, fieldOfScienceRepository: String, first: Int = 25, funderId: String, hasAffiliation: Boolean, hasCitations: Int, hasDownloads: Int, hasFunder: Boolean, hasMember: Boolean, hasOrganization: Boolean, hasParts: Int, hasPerson: Boolean, hasVersions: Int, hasViews: Int, ids: [String!], language: String, license: String, memberId: String, published: String, query: String, registrationAgency: String, repositoryId: String, repositoryType: String, userId: String): ModelConnectionWithTotal! organization(crossrefFunderId: ID, gridId: ID, id: ID): Organization! organizations(after: String, country: String, query: String, types: String): OrganizationConnectionWithTotal! other(id: ID!): Other! - others(after: String, facetCount: Int = 10, fieldOfScience: String, fieldOfScienceCombined: String, fieldOfScienceRepository: String, first: Int = 25, funderId: String, hasAffiliation: Boolean, hasCitations: Int, hasDownloads: Int, hasFunder: Boolean, hasMember: Boolean, hasOrganization: Boolean, hasParts: Int, hasPerson: Boolean, hasVersions: Int, hasViews: Int, ids: [String!], language: String, license: String, memberId: String, published: String, query: String, registrationAgency: String, repositoryId: String, userId: String): OtherConnectionWithTotal! + others(after: String, facetCount: Int = 10, fieldOfScience: String, fieldOfScienceCombined: String, fieldOfScienceRepository: String, first: Int = 25, funderId: String, hasAffiliation: Boolean, hasCitations: Int, hasDownloads: Int, hasFunder: Boolean, hasMember: Boolean, hasOrganization: Boolean, hasParts: Int, hasPerson: Boolean, hasVersions: Int, hasViews: Int, ids: [String!], language: String, license: String, memberId: String, published: String, query: String, registrationAgency: String, repositoryId: String, repositoryType: String, userId: String): OtherConnectionWithTotal! peerReview(id: ID!): PeerReview! - peerReviews(after: String, facetCount: Int = 10, fieldOfScience: String, fieldOfScienceCombined: String, fieldOfScienceRepository: String, first: Int = 25, funderId: String, hasAffiliation: Boolean, hasCitations: Int, hasDownloads: Int, hasFunder: Boolean, hasMember: Boolean, hasOrganization: Boolean, hasParts: Int, hasPerson: Boolean, hasVersions: Int, hasViews: Int, ids: [String!], language: String, license: String, memberId: String, published: String, query: String, registrationAgency: String, repositoryId: String, userId: String): PeerReviewConnectionWithTotal! + peerReviews(after: String, facetCount: Int = 10, fieldOfScience: String, fieldOfScienceCombined: String, fieldOfScienceRepository: String, first: Int = 25, funderId: String, hasAffiliation: Boolean, hasCitations: Int, hasDownloads: Int, hasFunder: Boolean, hasMember: Boolean, hasOrganization: Boolean, hasParts: Int, hasPerson: Boolean, hasVersions: Int, hasViews: Int, ids: [String!], language: String, license: String, memberId: String, published: String, query: String, registrationAgency: String, repositoryId: String, repositoryType: String, userId: String): PeerReviewConnectionWithTotal! people(after: String, first: Int = 25, query: String): PersonConnectionWithTotal! person(id: ID!): Person! physicalObject(id: ID!): PhysicalObject! - physicalObjects(after: String, facetCount: Int = 10, fieldOfScience: String, fieldOfScienceCombined: String, fieldOfScienceRepository: String, first: Int = 25, funderId: String, hasAffiliation: Boolean, hasCitations: Int, hasDownloads: Int, hasFunder: Boolean, hasMember: Boolean, hasOrganization: Boolean, hasParts: Int, hasPerson: Boolean, hasVersions: Int, hasViews: Int, ids: [String!], language: String, license: String, memberId: String, published: String, query: String, registrationAgency: String, repositoryId: String, userId: String): PhysicalObjectConnectionWithTotal! + physicalObjects(after: String, facetCount: Int = 10, fieldOfScience: String, fieldOfScienceCombined: String, fieldOfScienceRepository: String, first: Int = 25, funderId: String, hasAffiliation: Boolean, hasCitations: Int, hasDownloads: Int, hasFunder: Boolean, hasMember: Boolean, hasOrganization: Boolean, hasParts: Int, hasPerson: Boolean, hasVersions: Int, hasViews: Int, ids: [String!], language: String, license: String, memberId: String, published: String, query: String, registrationAgency: String, repositoryId: String, repositoryType: String, userId: String): PhysicalObjectConnectionWithTotal! prefix(id: ID!): Prefix! prefixes(after: String, first: Int = 25, query: String): PrefixConnectionWithTotal! preprint(id: ID!): Preprint! - preprints(after: String, facetCount: Int = 10, fieldOfScience: String, fieldOfScienceCombined: String, fieldOfScienceRepository: String, first: Int = 25, funderId: String, hasAffiliation: Boolean, hasCitations: Int, hasDownloads: Int, hasFunder: Boolean, hasMember: Boolean, hasOrganization: Boolean, hasParts: Int, hasPerson: Boolean, hasVersions: Int, hasViews: Int, ids: [String!], language: String, license: String, memberId: String, published: String, query: String, registrationAgency: String, repositoryId: String, userId: String): PreprintConnectionWithTotal! + preprints(after: String, facetCount: Int = 10, fieldOfScience: String, fieldOfScienceCombined: String, fieldOfScienceRepository: String, first: Int = 25, funderId: String, hasAffiliation: Boolean, hasCitations: Int, hasDownloads: Int, hasFunder: Boolean, hasMember: Boolean, hasOrganization: Boolean, hasParts: Int, hasPerson: Boolean, hasVersions: Int, hasViews: Int, ids: [String!], language: String, license: String, memberId: String, published: String, query: String, registrationAgency: String, repositoryId: String, repositoryType: String, userId: String): PreprintConnectionWithTotal! publication(id: ID!): Publication! - publications(after: String, facetCount: Int = 10, fieldOfScience: String, fieldOfScienceCombined: String, fieldOfScienceRepository: String, first: Int = 25, funderId: String, hasAffiliation: Boolean, hasCitations: Int, hasDownloads: Int, hasFunder: Boolean, hasMember: Boolean, hasOrganization: Boolean, hasParts: Int, hasPerson: Boolean, hasVersions: Int, hasViews: Int, ids: [String!], language: String, license: String, memberId: String, published: String, query: String, registrationAgency: String, repositoryId: String, userId: String): PublicationConnectionWithTotal! + publications(after: String, facetCount: Int = 10, fieldOfScience: String, fieldOfScienceCombined: String, fieldOfScienceRepository: String, first: Int = 25, funderId: String, hasAffiliation: Boolean, hasCitations: Int, hasDownloads: Int, hasFunder: Boolean, hasMember: Boolean, hasOrganization: Boolean, hasParts: Int, hasPerson: Boolean, hasVersions: Int, hasViews: Int, ids: [String!], language: String, license: String, memberId: String, published: String, query: String, registrationAgency: String, repositoryId: String, repositoryType: String, userId: String): PublicationConnectionWithTotal! repositories(after: String, certificate: String, first: Int = 25, hasPid: String, isCertified: String, isDisciplinary: String, isOpen: String, query: String, repositoryType: String, software: String, subject: String, subjectId: String): RepositoryConnectionWithTotal! repository(id: ID!): Repository! service(id: ID!): Service! - services(after: String, facetCount: Int = 10, fieldOfScience: String, fieldOfScienceCombined: String, fieldOfScienceRepository: String, first: Int = 25, funderId: String, hasAffiliation: Boolean, hasCitations: Int, hasDownloads: Int, hasFunder: Boolean, hasMember: Boolean, hasOrganization: Boolean, hasParts: Int, hasPerson: Boolean, hasVersions: Int, hasViews: Int, ids: [String!], language: String, license: String, memberId: String, pidEntity: String, published: String, query: String, registrationAgency: String, repositoryId: String, userId: String): ServiceConnectionWithTotal! + services(after: String, facetCount: Int = 10, fieldOfScience: String, fieldOfScienceCombined: String, fieldOfScienceRepository: String, first: Int = 25, funderId: String, hasAffiliation: Boolean, hasCitations: Int, hasDownloads: Int, hasFunder: Boolean, hasMember: Boolean, hasOrganization: Boolean, hasParts: Int, hasPerson: Boolean, hasVersions: Int, hasViews: Int, ids: [String!], language: String, license: String, memberId: String, pidEntity: String, published: String, query: String, registrationAgency: String, repositoryId: String, repositoryType: String, userId: String): ServiceConnectionWithTotal! software(id: ID!): Software! - softwares(after: String, facetCount: Int = 10, fieldOfScience: String, fieldOfScienceCombined: String, fieldOfScienceRepository: String, first: Int = 25, funderId: String, hasAffiliation: Boolean, hasCitations: Int, hasDownloads: Int, hasFunder: Boolean, hasMember: Boolean, hasOrganization: Boolean, hasParts: Int, hasPerson: Boolean, hasVersions: Int, hasViews: Int, ids: [String!], language: String, license: String, memberId: String, published: String, query: String, registrationAgency: String, repositoryId: String, userId: String): SoftwareConnectionWithTotal! + softwares(after: String, facetCount: Int = 10, fieldOfScience: String, fieldOfScienceCombined: String, fieldOfScienceRepository: String, first: Int = 25, funderId: String, hasAffiliation: Boolean, hasCitations: Int, hasDownloads: Int, hasFunder: Boolean, hasMember: Boolean, hasOrganization: Boolean, hasParts: Int, hasPerson: Boolean, hasVersions: Int, hasViews: Int, ids: [String!], language: String, license: String, memberId: String, published: String, query: String, registrationAgency: String, repositoryId: String, repositoryType: String, userId: String): SoftwareConnectionWithTotal! sound(id: ID!): Sound! - sounds(after: String, facetCount: Int = 10, fieldOfScience: String, fieldOfScienceCombined: String, fieldOfScienceRepository: String, first: Int = 25, funderId: String, hasAffiliation: Boolean, hasCitations: Int, hasDownloads: Int, hasFunder: Boolean, hasMember: Boolean, hasOrganization: Boolean, hasParts: Int, hasPerson: Boolean, hasVersions: Int, hasViews: Int, ids: [String!], language: String, license: String, memberId: String, published: String, query: String, registrationAgency: String, repositoryId: String, userId: String): SoundConnectionWithTotal! + sounds(after: String, facetCount: Int = 10, fieldOfScience: String, fieldOfScienceCombined: String, fieldOfScienceRepository: String, first: Int = 25, funderId: String, hasAffiliation: Boolean, hasCitations: Int, hasDownloads: Int, hasFunder: Boolean, hasMember: Boolean, hasOrganization: Boolean, hasParts: Int, hasPerson: Boolean, hasVersions: Int, hasViews: Int, ids: [String!], language: String, license: String, memberId: String, published: String, query: String, registrationAgency: String, repositoryId: String, repositoryType: String, userId: String): SoundConnectionWithTotal! usageReport(id: ID!): UsageReport! usageReports( """ @@ -9245,8 +9264,8 @@ type Query { ): UsageReportConnectionWithTotal! work(id: ID!): Work! workflow(id: ID!): Workflow! - workflows(after: String, facetCount: Int = 10, fieldOfScience: String, fieldOfScienceCombined: String, fieldOfScienceRepository: String, first: Int = 25, funderId: String, hasAffiliation: Boolean, hasCitations: Int, hasDownloads: Int, hasFunder: Boolean, hasMember: Boolean, hasOrganization: Boolean, hasParts: Int, hasPerson: Boolean, hasVersions: Int, hasViews: Int, ids: [String!], language: String, license: String, memberId: String, published: String, query: String, registrationAgency: String, repositoryId: String, userId: String): WorkflowConnectionWithTotal! - works(after: String, facetCount: Int = 10, fieldOfScience: String, fieldOfScienceCombined: String, fieldOfScienceRepository: String, first: Int = 25, funderId: String, hasAffiliation: Boolean, hasCitations: Int, hasDownloads: Int, hasFunder: Boolean, hasMember: Boolean, hasOrganization: Boolean, hasParts: Int, hasPerson: Boolean, hasVersions: Int, hasViews: Int, ids: [String!], language: String, license: String, memberId: String, published: String, query: String, registrationAgency: String, repositoryId: String, resourceType: String, resourceTypeId: String, userId: String): WorkConnectionWithTotal! + workflows(after: String, facetCount: Int = 10, fieldOfScience: String, fieldOfScienceCombined: String, fieldOfScienceRepository: String, first: Int = 25, funderId: String, hasAffiliation: Boolean, hasCitations: Int, hasDownloads: Int, hasFunder: Boolean, hasMember: Boolean, hasOrganization: Boolean, hasParts: Int, hasPerson: Boolean, hasVersions: Int, hasViews: Int, ids: [String!], language: String, license: String, memberId: String, published: String, query: String, registrationAgency: String, repositoryId: String, repositoryType: String, userId: String): WorkflowConnectionWithTotal! + works(after: String, facetCount: Int = 10, fieldOfScience: String, fieldOfScienceCombined: String, fieldOfScienceRepository: String, first: Int = 25, funderId: String, hasAffiliation: Boolean, hasCitations: Int, hasDownloads: Int, hasFunder: Boolean, hasMember: Boolean, hasOrganization: Boolean, hasParts: Int, hasPerson: Boolean, hasVersions: Int, hasViews: Int, ids: [String!], language: String, license: String, memberId: String, published: String, query: String, registrationAgency: String, repositoryId: String, repositoryType: String, resourceType: String, resourceTypeId: String, userId: String): WorkConnectionWithTotal! } """ @@ -10127,6 +10146,7 @@ type ServiceConnectionWithTotal implements WorkFacetsInterface { published: [Facet!] registrationAgencies: [Facet!] repositories: [Facet!] + repositoryTypes: [Facet!] totalCount: Int! } @@ -10502,6 +10522,7 @@ type SoftwareConnectionWithTotal implements WorkFacetsInterface { published: [Facet!] registrationAgencies: [Facet!] repositories: [Facet!] + repositoryTypes: [Facet!] softwareConnectionCount: Int! totalCount: Int! } @@ -10848,6 +10869,7 @@ type SoundConnectionWithTotal implements WorkFacetsInterface { published: [Facet!] registrationAgencies: [Facet!] repositories: [Facet!] + repositoryTypes: [Facet!] totalCount: Int! } @@ -11404,6 +11426,7 @@ type WorkConnectionWithTotal implements WorkFacetsInterface { published: [Facet!] registrationAgencies: [Facet!] repositories: [Facet!] + repositoryTypes: [Facet!] resourceTypes: [Facet!] totalContentUrl: Int totalCount: Int! @@ -11441,6 +11464,7 @@ interface WorkFacetsInterface { published: [Facet!] registrationAgencies: [Facet!] repositories: [Facet!] + repositoryTypes: [Facet!] totalCount: Int! } @@ -11771,6 +11795,7 @@ type WorkflowConnectionWithTotal implements WorkFacetsInterface { published: [Facet!] registrationAgencies: [Facet!] repositories: [Facet!] + repositoryTypes: [Facet!] totalCount: Int! } diff --git a/app/graphql/types/interfaces/work_facets_interface.rb b/app/graphql/types/interfaces/work_facets_interface.rb index baa78cfe7..044dc29c6 100644 --- a/app/graphql/types/interfaces/work_facets_interface.rb +++ b/app/graphql/types/interfaces/work_facets_interface.rb @@ -19,6 +19,7 @@ module Interfaces::WorkFacetsInterface field :fields_of_science_repository, [FacetType], null: true, cache: true field :licenses, [FacetType], null: true, cache: true field :languages, [FacetType], null: true, cache: true + field :repository_types, [FacetType], null: true, cache: true field :person_to_work_types_multilevel, [MultiFacetType], null: true, cache: true def person_to_work_types_multilevel @@ -140,4 +141,12 @@ def languages [] end end + + def repository_types + if object.aggregations.client_types + facet_by_client_type(object.aggregations.client_types.buckets) + else + [] + end + end end diff --git a/app/graphql/types/query_type.rb b/app/graphql/types/query_type.rb index 2f6ac604b..f56b2f432 100644 --- a/app/graphql/types/query_type.rb +++ b/app/graphql/types/query_type.rb @@ -256,6 +256,7 @@ def actor(id:) argument :user_id, String, required: false argument :funder_id, String, required: false argument :repository_id, String, required: false + argument :repository_type, String, required: false argument :member_id, String, required: false argument :registration_agency, String, required: false argument :resource_type_id, String, required: false @@ -303,6 +304,7 @@ def work(id:) argument :user_id, String, required: false argument :funder_id, String, required: false argument :repository_id, String, required: false + argument :repository_type, String, required: false argument :member_id, String, required: false argument :registration_agency, String, required: false argument :license, String, required: false @@ -345,6 +347,7 @@ def dataset(id:) argument :user_id, String, required: false argument :funder_id, String, required: false argument :repository_id, String, required: false + argument :repository_type, String, required: false argument :member_id, String, required: false argument :registration_agency, String, required: false argument :license, String, required: false @@ -387,6 +390,7 @@ def publication(id:) argument :user_id, String, required: false argument :funder_id, String, required: false argument :repository_id, String, required: false + argument :repository_type, String, required: false argument :member_id, String, required: false argument :registration_agency, String, required: false argument :license, String, required: false @@ -429,6 +433,7 @@ def audiovisual(id:) argument :user_id, String, required: false argument :funder_id, String, required: false argument :repository_id, String, required: false + argument :repository_type, String, required: false argument :member_id, String, required: false argument :registration_agency, String, required: false argument :license, String, required: false @@ -471,6 +476,7 @@ def collection(id:) argument :user_id, String, required: false argument :funder_id, String, required: false argument :repository_id, String, required: false + argument :repository_type, String, required: false argument :member_id, String, required: false argument :registration_agency, String, required: false argument :license, String, required: false @@ -513,6 +519,7 @@ def data_paper(id:) argument :published, String, required: false argument :user_id, String, required: false argument :repository_id, String, required: false + argument :repository_type, String, required: false argument :member_id, String, required: false argument :registration_agency, String, required: false argument :license, String, required: false @@ -553,6 +560,7 @@ def event(id:) argument :user_id, String, required: false argument :funder_id, String, required: false argument :repository_id, String, required: false + argument :repository_type, String, required: false argument :member_id, String, required: false argument :registration_agency, String, required: false argument :license, String, required: false @@ -595,6 +603,7 @@ def image(id:) argument :user_id, String, required: false argument :funder_id, String, required: false argument :repository_id, String, required: false + argument :repository_type, String, required: false argument :member_id, String, required: false argument :registration_agency, String, required: false argument :license, String, required: false @@ -637,6 +646,7 @@ def interactive_resource(id:) argument :user_id, String, required: false argument :funder_id, String, required: false argument :repository_id, String, required: false + argument :repository_type, String, required: false argument :member_id, String, required: false argument :registration_agency, String, required: false argument :license, String, required: false @@ -679,6 +689,7 @@ def model(id:) argument :user_id, String, required: false argument :funder_id, String, required: false argument :repository_id, String, required: false + argument :repository_type, String, required: false argument :member_id, String, required: false argument :registration_agency, String, required: false argument :license, String, required: false @@ -721,6 +732,7 @@ def physical_object(id:) argument :user_id, String, required: false argument :funder_id, String, required: false argument :repository_id, String, required: false + argument :repository_type, String, required: false argument :member_id, String, required: false argument :registration_agency, String, required: false argument :license, String, required: false @@ -764,6 +776,7 @@ def service(id:) argument :user_id, String, required: false argument :funder_id, String, required: false argument :repository_id, String, required: false + argument :repository_type, String, required: false argument :member_id, String, required: false argument :registration_agency, String, required: false argument :license, String, required: false @@ -806,6 +819,7 @@ def software(id:) argument :user_id, String, required: false argument :funder_id, String, required: false argument :repository_id, String, required: false + argument :repository_type, String, required: false argument :member_id, String, required: false argument :registration_agency, String, required: false argument :license, String, required: false @@ -848,6 +862,7 @@ def sound(id:) argument :user_id, String, required: false argument :funder_id, String, required: false argument :repository_id, String, required: false + argument :repository_type, String, required: false argument :member_id, String, required: false argument :registration_agency, String, required: false argument :license, String, required: false @@ -890,6 +905,7 @@ def workflow(id:) argument :user_id, String, required: false argument :funder_id, String, required: false argument :repository_id, String, required: false + argument :repository_type, String, required: false argument :member_id, String, required: false argument :registration_agency, String, required: false argument :license, String, required: false @@ -933,6 +949,7 @@ def dissertation(id:) argument :user_id, String, required: false argument :funder_id, String, required: false argument :repository_id, String, required: false + argument :repository_type, String, required: false argument :member_id, String, required: false argument :registration_agency, String, required: false argument :license, String, required: false @@ -976,6 +993,7 @@ def data_management_plan(id:) argument :user_id, String, required: false argument :funder_id, String, required: false argument :repository_id, String, required: false + argument :repository_type, String, required: false argument :member_id, String, required: false argument :registration_agency, String, required: false argument :license, String, required: false @@ -1019,6 +1037,7 @@ def preprint(id:) argument :user_id, String, required: false argument :funder_id, String, required: false argument :repository_id, String, required: false + argument :repository_type, String, required: false argument :member_id, String, required: false argument :registration_agency, String, required: false argument :license, String, required: false @@ -1062,6 +1081,7 @@ def peer_review(id:) argument :user_id, String, required: false argument :funder_id, String, required: false argument :repository_id, String, required: false + argument :repository_type, String, required: false argument :member_id, String, required: false argument :registration_agency, String, required: false argument :license, String, required: false @@ -1105,6 +1125,7 @@ def conference_paper(id:) argument :user_id, String, required: false argument :funder_id, String, required: false argument :repository_id, String, required: false + argument :repository_type, String, required: false argument :member_id, String, required: false argument :registration_agency, String, required: false argument :license, String, required: false @@ -1148,6 +1169,7 @@ def book_chapter(id:) argument :user_id, String, required: false argument :funder_id, String, required: false argument :repository_id, String, required: false + argument :repository_type, String, required: false argument :member_id, String, required: false argument :registration_agency, String, required: false argument :license, String, required: false @@ -1191,6 +1213,7 @@ def book(id:) argument :user_id, String, required: false argument :funder_id, String, required: false argument :repository_id, String, required: false + argument :repository_type, String, required: false argument :member_id, String, required: false argument :registration_agency, String, required: false argument :license, String, required: false @@ -1234,6 +1257,7 @@ def journal_article(id:) argument :user_id, String, required: false argument :funder_id, String, required: false argument :repository_id, String, required: false + argument :repository_type, String, required: false argument :member_id, String, required: false argument :registration_agency, String, required: false argument :license, String, required: false @@ -1277,6 +1301,7 @@ def instrument(id:) argument :user_id, String, required: false argument :funder_id, String, required: false argument :repository_id, String, required: false + argument :repository_type, String, required: false argument :member_id, String, required: false argument :registration_agency, String, required: false argument :license, String, required: false @@ -1337,6 +1362,7 @@ def response(**args) ids: args[:ids], user_id: args[:user_id], client_id: args[:repository_id], + client_type: args[:repository_type], provider_id: args[:member_id], funder_id: args[:funder_id], resource_type_id: args[:resource_type_id], diff --git a/app/models/doi/graphql_query.rb b/app/models/doi/graphql_query.rb index 6c10d1599..660de86ab 100644 --- a/app/models/doi/graphql_query.rb +++ b/app/models/doi/graphql_query.rb @@ -175,6 +175,8 @@ def filters filter << { terms: { "client.certificate" => options[:certificate].split(",") } } if options[:certificate].present? filter << { terms: { "creators.nameIdentifiers.nameIdentifier" => options[:user_id].split(",").collect { |id| "https://orcid.org/#{orcid_from_url(id)}" } } } if options[:user_id].present? filter << { term: { "creators.nameIdentifiers.nameIdentifierScheme" => "ORCID" } } if options[:has_person].present? + filter << { term: { "client.client_type" => options[:client_type] } } if options[:client_type] + filter << { term: { "types.resourceTypeGeneral" => "PhysicalObject" } } if options[:client_type] == "igsnCatalog" filter end @@ -407,6 +409,13 @@ def aggregations download_count: { sum: { field: "download_count" } }, citation_count: { sum: { field: "citation_count" } }, content_url_count: { value_count: { field: "content_url" } }, + client_types: { + terms: { + field: "client.client_type", + size: facet_count, + min_doc_count: 1 + } + } } end end diff --git a/spec/graphql/types/work_type_spec.rb b/spec/graphql/types/work_type_spec.rb index bd73f974e..92deeef52 100644 --- a/spec/graphql/types/work_type_spec.rb +++ b/spec/graphql/types/work_type_spec.rb @@ -2221,3 +2221,93 @@ expect(response.dig("data", "works", "nodes", 0, "types", "resourceTypeGeneral")).to eq("StudyRegistration") end end + +describe "query with client_type facet", elasticsearch: true do + let(:provider) { create(:provider) } + let(:client_repository) { create(:client, provider: provider, client_type: "repository") } + let(:client_periodical) { create(:client, provider: provider, client_type: "periodical") } + let(:client_igsn_id_catalog) { create(:client, provider: provider, client_type: "igsnCatalog") } + let(:client_raid_registry) { create(:client, provider: provider, client_type: "raidRegistry") } + let!(:dois_repository) { create_list(:doi, 10, client: client_repository, aasm_state: "findable", version_info: "testtag") } + let!(:dois_periodical) { create_list(:doi, 10, client: client_periodical, aasm_state: "findable", version_info: "testtag") } + let!(:doi_igsn_id) { create(:doi, client: client_igsn_id_catalog, aasm_state: "findable", types: { "resourceTypeGeneral": "PhysicalObject" }) } + let!(:doi_igsn_id_dataset) { create(:doi, client: client_igsn_id_catalog, aasm_state: "findable", types: { "resourceTypeGeneral": "Dataset" }) } + let!(:doi_raid_registry) { create(:doi, client: client_raid_registry, aasm_state: "findable") } + + before do + Doi.import + sleep 2 + end + + let(:query) do + "query($first: Int, $cursor: String) { + works(first: $first, after: $cursor) { + totalCount + repositoryTypes { + id + title + count + } + nodes { + doi + types { + resourceTypeGeneral + } + } + } + }" + end + + let(:query_with_client_type_filter) do + "query($first: Int, $cursor: String, $repositoryType: String) { + works(first: $first, after: $cursor, repositoryType: $repositoryType) { + totalCount + repositoryTypes { + id + title + count + } + nodes { + doi + types { + resourceTypeGeneral + } + } + } + }" + end + + it "returns repositoryTypes facet" do + response = + LupoSchema.execute( + query, + ). + as_json + + expect(response.dig("data", "works", "totalCount")).to eq(23) + expect(response.dig("data", "works", "repositoryTypes")).to eq( + [ + { "count" => 10, "id" => "periodical", "title" => "Periodical" }, + { "count" => 10, "id" => "repository", "title" => "Repository" }, + { "count" => 2, "id" => "igsnCatalog", "title" => "IGSN ID Catalog" }, + { "count" => 1, "id" => "raidRegistry", "title" => "RAiD Registry" }, + ] + ) + end + + it "returns filtered DOIs by repositoryType and only returns PhysicalObjects for igsnCatalog filter" do + response = + LupoSchema.execute( + query_with_client_type_filter, + variables: { first: 15, cursor: nil, repositoryType: "igsnCatalog" } + ). + as_json + + expect(response.dig("data", "works", "totalCount")).to eq(1) + expect(response.dig("data", "works", "repositoryTypes")).to eq( + [ + { "count" => 1, "id" => "igsnCatalog", "title" => "IGSN ID Catalog" }, + ] + ) + end +end