Documents
Vérifier app.capabilities pour la prise en charge des fonctionnalités et app.access ainsi que les permissions de l’hôte pour les autorisations. Les exemples utilisent des valeurs synthétiques ; remplacer les chemins, ID, entrées et filtres avant tout appel.
Définitions de types
type Query {
docCount(query: String!): Int!
docExtGroups(query: String! = ""): [DocExtGroup!]!
docs(query: String!, offset: Int!, limit: Int!, sortBy: DocSortBy!): [Doc!]!
}
enum DataType {
DEFAULT
AUDIO
VIDEO
IMAGE
SMS
CONTACT
NOTE
FEED_ENTRY
CALL
PACKAGE
FILE
APP_FILE
DOC
}
type Doc implements MediaItem {
id: ID!
title: String!
path: String!
extension: String!
size: Long!
bucketId: ID!
createdAt: Instant!
updatedAt: Instant!
tags: [Tag!]!
}
type DocExtGroup {
ext: String!
count: Int!
}
enum DocSortBy {
UPDATED_AT_ASC
UPDATED_AT_DESC
SIZE_ASC
SIZE_DESC
NAME_ASC
NAME_DESC
}
scalar Instant
scalar Long
interface MediaItem {
id: ID!
title: String!
path: String!
size: Long!
bucketId: ID!
createdAt: Instant!
updatedAt: Instant!
}
type Tag {
id: ID!
name: String!
type: DataType!
count: Int!
}Opérations
docCount
Compter les documents correspondant à une requête.
query docCount($query: String!) {
docCount(query: $query)
}docExtGroups
Lister toutes les extensions de fichiers distinctes avec leur nombre. Utile pour créer une interface de filtrage par type.
query docExtGroups($query: String!) {
docExtGroups(query: $query) { ext count }
}docs
Rechercher des documents. Laisser query vide pour tous les lister.
query docs($query: String!, $offset: Int!, $limit: Int!, $sortBy: DocSortBy!) {
docs(query: $query, offset: $offset, limit: $limit, sortBy: $sortBy) { id title path extension size bucketId createdAt updatedAt }
}