Changeset View
Changeset View
Standalone View
Standalone View
swh/graphql/schema/schema.graphql
""" | """ | ||||
SoftWare Heritage persistent Identifier | SoftWare Heritage persistent Identifier | ||||
""" | """ | ||||
scalar SWHID | scalar SWHID | ||||
""" | """ | ||||
ISO-8601 encoded date string | ISO-8601 encoded date string | ||||
""" | """ | ||||
scalar DateTime | scalar DateTime | ||||
""" | """ | ||||
Content identifier in the form hash-type:hash-value | |||||
""" | |||||
scalar ContentHash | |||||
""" | |||||
Object with an id | Object with an id | ||||
""" | """ | ||||
interface Node { | interface Node { | ||||
""" | """ | ||||
Id of the object. This is for caching purpose and | Id of the object. This is for caching purpose and | ||||
should not be used outside the GraphQL API | should not be used outside the GraphQL API | ||||
""" | """ | ||||
id: ID! | id: ID! | ||||
▲ Show 20 Lines • Show All 730 Lines • ▼ Show 20 Lines | entries( | ||||
""" | """ | ||||
Returns the page after this cursor | Returns the page after this cursor | ||||
""" | """ | ||||
after: String | after: String | ||||
): DirectoryEntryConnection | ): DirectoryEntryConnection | ||||
} | } | ||||
""" | """ | ||||
An object with different checksums | An object with different content checksums | ||||
""" | """ | ||||
type ContentChecksum { | type ContentChecksum { | ||||
blake2s256: String | |||||
sha1: String | |||||
sha1_git: String | |||||
sha256: String | |||||
} | |||||
""" | """ | ||||
Object with different content data representations | |||||
""" | """ | ||||
blake2s256: String | type ContentData { | ||||
""" | |||||
URL to download the file data | |||||
""" | |||||
url: String | |||||
} | |||||
type ContentFileType { | |||||
""" | """ | ||||
Detected content encoding | |||||
""" | """ | ||||
sha1: String | encoding: String | ||||
""" | """ | ||||
Detected MIME type of the content | |||||
""" | """ | ||||
sha1_git: String | mimetype: String | ||||
} | |||||
type ContentLanguage { | |||||
""" | """ | ||||
Detected programming language if any | |||||
""" | """ | ||||
sha256: String | lang: String | ||||
} | |||||
type ContentLicense { | |||||
""" | |||||
Array of strings containing the detected license names | |||||
""" | |||||
licenses: [String] | |||||
} | } | ||||
""" | """ | ||||
A content object | A content object | ||||
""" | """ | ||||
type Content implements MerkleNode & Node { | type Content implements MerkleNode & Node { | ||||
""" | """ | ||||
Unique identifier | Unique identifier | ||||
Show All 14 Lines | type Content implements MerkleNode & Node { | ||||
Length of the content in bytes | Length of the content in bytes | ||||
""" | """ | ||||
length: Int | length: Int | ||||
""" | """ | ||||
Content status, visible or hidden | Content status, visible or hidden | ||||
""" | """ | ||||
status: String | status: String | ||||
""" | |||||
File content | |||||
""" | |||||
data: ContentData | |||||
""" | |||||
Information about the content MIME type | |||||
""" | |||||
fileType: ContentFileType | |||||
""" | |||||
Information about the programming language used in the content | |||||
""" | |||||
language: ContentLanguage | |||||
""" | |||||
Information about the license of the content | |||||
""" | |||||
license: ContentLicense | |||||
} | } | ||||
""" | """ | ||||
Connection to SearchResults | Connection to SearchResults | ||||
""" | """ | ||||
type SearchResultConnection { | type SearchResultConnection { | ||||
""" | """ | ||||
List of SearchResult edges | List of SearchResult edges | ||||
▲ Show 20 Lines • Show All 152 Lines • ▼ Show 20 Lines | type Query { | ||||
content( | content( | ||||
""" | """ | ||||
SWHID of the content object | SWHID of the content object | ||||
""" | """ | ||||
swhid: SWHID! | swhid: SWHID! | ||||
): Content | ): Content | ||||
""" | """ | ||||
Get the content by one or more hashes | |||||
Use multiple hashes for an accurate result | |||||
""" | |||||
contentByHash( | |||||
""" | |||||
List of hashType:hashValue strings | |||||
""" | |||||
checksums: [ContentHash]! | |||||
): Content | |||||
""" | |||||
Resolve the given SWHID to an object | Resolve the given SWHID to an object | ||||
""" | """ | ||||
resolveSwhid( | resolveSwhid( | ||||
""" | """ | ||||
SWHID to look for | SWHID to look for | ||||
""" | """ | ||||
swhid: SWHID! | swhid: SWHID! | ||||
): SearchResultConnection! | ): SearchResultConnection! | ||||
} | } |