API Reference

Documents

Browse document files (PDF, Office, text, etc.) indexed by the Android MediaStore.

Type Definitions

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
}

Operations

query

docs

Search documents. Leave query empty to list all.

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

Count documents matching a query.

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

docExtGroups

List all distinct file extensions and their counts. Useful for building a "filter by type" UI.

bash
query GetDocExtGroups {
  docExtGroups { ext count }
}