API 参考
Documents
浏览由 Android MediaStore 索引的文档文件(PDF、Office、文本等)。
类型定义
bash
type Doc {
id: ID!
title: String! # filename
path: String!
size: Int! # bytes
bucketId: String! # media store bucket
createdAt: String!
updatedAt: String!
tags: [Tag!]!
}
type DocExtGroup {
ext: String! # file extension without dot, e.g. "pdf"
count: Int!
}
enum FileSortBy {
SIZE_ASC SIZE_DESC
NAME_ASC NAME_DESC
DATE_ADDED_ASC DATE_ADDED_DESC
DATE_MODIFIED_ASC DATE_MODIFIED_DESC
}操作
query
docs
搜索文档。查询留空可列出全部。
bash
query GetDocs($offset: Int!, $limit: Int!, $query: String!, $sortBy: FileSortBy!) {
docs(offset: $offset, limit: $limit, query: $query, sortBy: $sortBy) {
id title path size bucketId createdAt updatedAt
tags { id name }
}
}query
docCount
统计匹配查询的文档数量。
bash
query GetDocCount($query: String!) {
docCount(query: $query)
}query
docExtGroups
列出所有不同的文件扩展名及其数量。适用于构建 "按类型筛选" UI。
bash
query GetDocExtGroups {
docExtGroups { ext count }
}