diff --git a/swh/graphql/schema/schema.graphql b/swh/graphql/schema/schema.graphql --- a/swh/graphql/schema/schema.graphql +++ b/swh/graphql/schema/schema.graphql @@ -805,6 +805,55 @@ status: String } +""" +Connection to search results +""" +type SearchResultConnection { + """ + List of search result edges + """ + edges: [SearchResultEdge] + + """ + List of search result objects + """ + nodes: [SearchResult] + + """ + Information for pagination + """ + pageInfo: PageInfo! + + """ + Total number of origin objects in the connection + """ + totalCount: Int +} + +type SearchResultEdge { + """ + Cursor to request the next page after the item + """ + cursor: String! + + """ + Search result object + """ + node: SearchResult +} + +union SearchResultTarget = Revision | Release | Branch | Content | Directory | Snapshot | Origin + +""" +A search result object +""" +type SearchResult { + match: Int + result: SearchResultTarget + resultType: String + metadata: String +} + """ The query root of the GraphQL interface. """ @@ -903,4 +952,11 @@ """ swhid: SWHID! ): Content + + """ + Search the archive + """ + search( + searchTerm: String + ): SearchResultConnection }