Changeset View
Standalone View
swh/graphql/schema/schema.graphql
Show First 20 Lines • Show All 800 Lines • ▼ Show 20 Lines | type Content implements MerkleNode & Node { | ||||
""" | """ | ||||
Content status, visible or hidden | Content status, visible or hidden | ||||
""" | """ | ||||
status: String | status: String | ||||
} | } | ||||
""" | """ | ||||
Connection to SearchResults | |||||
""" | |||||
type SearchResultConnection { | |||||
""" | |||||
List of SearchResult edges | |||||
""" | |||||
edges: [SearchResultEdge] | |||||
""" | |||||
List of SearchResult objects | |||||
""" | |||||
nodes: [SearchResult] | |||||
""" | |||||
Information for pagination | |||||
""" | |||||
pageInfo: PageInfo! | |||||
""" | |||||
Total number of result objects in the connection | |||||
""" | |||||
totalCount: Int | |||||
} | |||||
""" | |||||
Edge in SearchResult connection | |||||
""" | |||||
type SearchResultEdge { | |||||
""" | |||||
Cursor to request the next page after the item | |||||
""" | |||||
cursor: String! | |||||
""" | |||||
SearchResult object | |||||
""" | |||||
node: SearchResult | |||||
} | |||||
union SearchResultTarget = Origin | Revision | Release | Content | Directory | Snapshot | |||||
enum SearchResultTargetType { | |||||
origin | |||||
revision | |||||
release | |||||
content | |||||
directory | |||||
snapshot | |||||
} | |||||
""" | |||||
A SearchResult object | |||||
""" | |||||
type SearchResult { | |||||
""" | |||||
Result target type | |||||
""" | |||||
type: SearchResultTargetType | |||||
""" | |||||
Result target object | |||||
""" | |||||
target: SearchResultTarget | |||||
} | |||||
""" | |||||
The query root of the GraphQL interface. | The query root of the GraphQL interface. | ||||
anlambert: Do we really need that match field ? How will you compute its value for origin search and when… | |||||
Done Inline ActionsThis can be 'null' where we can't compute a value. jayeshv: This can be 'null' where we can't compute a value.
I hope it will be useful with search indexes… | |||||
Not Done Inline ActionsI do not think it is needed as we use elasticsearch as a search backend (see swh-search) By the way, I saw that you are using the PostgreSQL search backend in current implementation. anlambert: I do not think it is needed as we use elasticsearch as a search backend (see [swh-search](https… | |||||
Done Inline ActionsThanks, I have the swh-search backend implementation in another diff. Origin search will be possible using the search entrypoint (not implemented yet) or by adding filters to the origins query (this is using Postgres backend at the moment). jayeshv: Thanks, I have the swh-search backend implementation in another diff.
Origin search will be… | |||||
""" | """ | ||||
type Query { | type Query { | ||||
""" | """ | ||||
Get an origin with its url | Get an origin with its url | ||||
""" | """ | ||||
origin( | origin( | ||||
""" | """ | ||||
URL of the Origin | URL of the Origin | ||||
▲ Show 20 Lines • Show All 80 Lines • ▼ Show 20 Lines | type Query { | ||||
Get the content with a SWHID | Get the content with a SWHID | ||||
""" | """ | ||||
content( | content( | ||||
""" | """ | ||||
SWHID of the content object | SWHID of the content object | ||||
""" | """ | ||||
swhid: SWHID! | swhid: SWHID! | ||||
): Content | ): Content | ||||
""" | |||||
Resolve the given SWHID to an object | |||||
""" | |||||
resolveSwhid( | |||||
""" | |||||
SWHID to look for | |||||
""" | |||||
swhid: SWHID! | |||||
): SearchResultConnection! | |||||
} | } |
Do we really need that match field ? How will you compute its value for origin search and when using query language ?