API Reference

Notes

API reference derived from the current plain-core schema. Check app.capabilities for feature support and app.access plus host permissions for authorization. Examples use synthetic values; replace paths, IDs, inputs and filters before calling.

Type Definitions

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

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

type ActionResult {
	affectedCount: Int!
}

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: Int!
	count: Int!
}

Operations

mutation

createNote

Create and persist a note from the supplied input.

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

deleteNotes

Permanently delete trashed notes matching a query. Only operates on already-trashed notes.

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

exportNotes

Serialize notes matching a query (including tags) as a JSON string for backup/transfer.

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

restoreNotes

Restore trashed notes matching a query.

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

saveFeedEntriesToNotes

Save matching feed entries as notes and return the created note IDs.

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

trashNotes

Move notes matching a query to the trash.

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

updateNote

Update a stored note from the supplied input.

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

note

Fetch a single note by ID.

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

noteCount

Count notes matching a query.

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

notes

Search notes (title + content). Leave query empty to list all non-trashed notes.

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