PlainApp
API 참조

태그

기능 지원은 app.capabilities, 인가는 app.access와 호스트 권한으로 확인하세요. 예제는 합성 값을 사용합니다. 호출 전에 경로, ID, 입력, 필터를 바꾸세요.

타입 정의

graphql
type Mutation {
  addToTags(type: DataType!, tagIds: [ID!]!, query: String!): Boolean!
  createTag(type: DataType!, name: String!): Tag!
  deleteTag(id: ID!): Boolean!
  removeFromTags(type: DataType!, tagIds: [ID!]!, query: String!): Boolean!
  updateTag(id: ID!, name: String!): Tag!
  updateTagRelations(type: DataType!, keys: [String!]!, addTagIds: [ID!]!, removeTagIds: [ID!]!): Boolean!
}

type Query {
  tagKeys(id: ID!): [String!]!
  tagRelations(type: DataType!, keys: [String!]!): [TagRelation!]!
  tags(type: DataType!): [Tag!]!
}

enum DataType {
	DEFAULT
	AUDIO
	VIDEO
	IMAGE
	SMS
	CONTACT
	NOTE
	FEED_ENTRY
	CALL
	PACKAGE
	FILE
	APP_FILE
	DOC
}

type Tag {
	id: ID!
	name: String!
	type: DataType!
	count: Int!
}

type TagRelation {
	tagId: ID!
	key: String!
}

작업

mutation

addToTags

쿼리에 일치하는 모든 항목을 하나 이상의 태그에 추가합니다.

graphql
mutation addToTags($type: DataType!, $tagIds: [ID!]!, $query: String!) {
  addToTags(type: $type, tagIds: $tagIds, query: $query)
}
mutation

createTag

데이터 타입 범위의 새 태그를 만듭니다.

graphql
mutation createTag($type: DataType!, $name: String!) {
  createTag(type: $type, name: $name) { id name type count }
}
mutation

deleteTag

태그를 삭제하고 태그된 모든 항목에서 제거합니다.

graphql
mutation deleteTag($id: ID!) {
  deleteTag(id: $id)
}
mutation

removeFromTags

쿼리에 일치하는 모든 항목을 하나 이상의 태그에서 제거합니다.

graphql
mutation removeFromTags($type: DataType!, $tagIds: [ID!]!, $query: String!) {
  removeFromTags(type: $type, tagIds: $tagIds, query: $query)
}
mutation

updateTag

기존 태그 이름을 변경합니다.

graphql
mutation updateTag($id: ID!, $name: String!) {
  updateTag(id: $id, name: $name) { id name type count }
}
mutation

updateTagRelations

한 번의 호출로 단일 항목의 태그를 추가 및/또는 제거합니다.

graphql
mutation updateTagRelations($type: DataType!, $keys: [String!]!, $addTagIds: [ID!]!, $removeTagIds: [ID!]!) {
  updateTagRelations(type: $type, keys: $keys, addTagIds: $addTagIds, removeTagIds: $removeTagIds)
}
query

tagKeys

지정한 태그에 연결된 항목 키를 나열합니다.

graphql
query tagKeys($id: ID!) {
  tagKeys(id: $id)
}
query

tagRelations

한 데이터 타입 내 항목 키 집합(예: 미디어 ID, 메모 ID)의 태그 할당을 조회합니다.

graphql
query tagRelations($type: DataType!, $keys: [String!]!) {
  tagRelations(type: $type, keys: $keys) { tagId key }
}
query

tags

지정한 데이터 타입의 모든 태그를 나열합니다.

graphql
query tags($type: DataType!) {
  tags(type: $type) { id name type count }
}