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 1,055 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 | Get a content that match all the given hashes. | ||||
Use multiple hashes for an accurate result | This entrypoint can be used to uniquely identify a content | ||||
lunar: As this API might be surprising at first, I think it’s worth being explicit on the problem it… | |||||
Done Inline ActionsAdded a bit bigger description. This will change again if we decide to return a list of contents instead of a single one. jayeshv: Added a bit bigger description. This will change again if we decide to return a list of… | |||||
in the event of hash conflicts. Use multiple hashes to | |||||
get an accurate result. | |||||
At least one of the four hashes must be provided. | |||||
""" | """ | ||||
contentByHashes( | contentByHashes( | ||||
""" | sha1: String | ||||
List of hashType:hashValue strings | |||||
""" | sha256: String | ||||
hashes: [ContentHash]! | |||||
sha1_git: String | |||||
blake2s256: String | |||||
): Content | ): 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 | ||||
Show All 24 Lines |
As this API might be surprising at first, I think it’s worth being explicit on the problem it is trying to solve.