Tham chiếu API

Documents

Duyệt các tệp tài liệu (PDF, Office, văn bản, v.v.) được lập chỉ mục bởi Android MediaStore.

Định nghĩa kiểu

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
}

Thao tác

query

docs

Tìm kiếm tài liệu. Để query trống để liệt kê tất cả.

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

Đếm tài liệu khớp với một query.

bash
query GetDocCount($query: String!) {
  docCount(query: $query)
}
query

docExtGroups

Liệt kê tất cả phần mở rộng tệp khác biệt và số lượng của chúng. Hữu ích cho việc xây dựng UI "lọc theo loại".

bash
query GetDocExtGroups {
  docExtGroups { ext count }
}