PlainApp
Referência da API

Notas

Verificar app.capabilities para o suporte de funcionalidades e app.access juntamente com as permissões do anfitrião para autorização. Os exemplos usam valores sintéticos; substituir caminhos, ID, entradas e filtros antes da chamada.

Definições de Tipo

graphql
type Mutation {
  createNote(input: NoteInput!): Note!
  deleteNotes(query: String!): ActionResult!
  restoreNotes(query: String!): ActionResult!
  saveFeedEntriesToNotes(query: String!): [ID!]!
  trashNotes(query: String!): ActionResult!
  updateNote(id: ID!, input: NoteInput!): Note!
}

type Query {
  exportNotes(query: String!): String!
  note(id: ID!): Note
  noteCount(query: String!): Int!
  notes(query: String!, offset: Int!, limit: Int!): [Note!]!
}

type ActionResult {
	affectedCount: Int!
}

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

scalar Instant

type Note {
	id: ID!
	title: String!
	content: String!
	deletedAt: Instant
	createdAt: Instant!
	updatedAt: Instant!
	tags: [Tag!]!
}

input NoteInput {
	title: String!
	content: String!
}

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

Operações

mutation

createNote

Criar e guardar uma nota a partir dos dados fornecidos.

graphql
mutation createNote($input: NoteInput!) {
  createNote(input: $input) { id title content deletedAt createdAt updatedAt }
}
mutation

deleteNotes

Eliminar permanentemente as notas no lixo que correspondam a uma consulta. Só atua sobre notas já no lixo.

graphql
mutation deleteNotes($query: String!) {
  deleteNotes(query: $query) { affectedCount }
}
mutation

restoreNotes

Restaurar as notas no lixo que correspondam a uma consulta.

graphql
mutation restoreNotes($query: String!) {
  restoreNotes(query: $query) { affectedCount }
}
mutation

saveFeedEntriesToNotes

Guardar como notas as entradas de feeds correspondentes e devolver os ID das notas criadas.

graphql
mutation saveFeedEntriesToNotes($query: String!) {
  saveFeedEntriesToNotes(query: $query)
}
mutation

trashNotes

Mover para o lixo as notas que correspondam a uma consulta.

graphql
mutation trashNotes($query: String!) {
  trashNotes(query: $query) { affectedCount }
}
mutation

updateNote

Atualizar uma nota guardada a partir dos dados fornecidos.

graphql
mutation updateNote($id: ID!, $input: NoteInput!) {
  updateNote(id: $id, input: $input) { id title content deletedAt createdAt updatedAt }
}
query

exportNotes

Serializar as notas que correspondam a uma consulta (incluindo etiquetas) como cadeia JSON para cópia de segurança ou transferência.

graphql
query exportNotes($query: String!) {
  exportNotes(query: $query)
}
query

note

Obter uma nota pelo ID.

graphql
query note($id: ID!) {
  note(id: $id) { id title content deletedAt createdAt updatedAt }
}
query

noteCount

Contar as notas que correspondam a uma consulta.

graphql
query noteCount($query: String!) {
  noteCount(query: $query)
}
query

notes

Pesquisar notas (título + conteúdo). Deixar query vazio para listar todas as notas que não estejam no lixo.

graphql
query notes($query: String!, $offset: Int!, $limit: Int!) {
  notes(query: $query, offset: $offset, limit: $limit) { id title content deletedAt createdAt updatedAt }
}