rl-docs-hub

Home · Apps · rl-main-infra · todo_api · todo_mobile


API Specs

GraphQL API exposed by NestJS (@nestjs/apollo) with auto-generated schema (autoSchemaFile: true).

Endpoint & Auth

Resolver Surface

Queries

Query Args Returns Notes
todoLists none [TodoList!]! Owner-scoped by JWT sub, sorted by order, then createdAt
todoItems listId?: String [TodoItem!]! Owner-scoped; optional list filter; sorted by listId, position, createdAt
pullChanges since?: String PullChangesResult! Incremental sync stream based on createdAt cursor

Mutations

Mutation Args Returns Behavior
createTodoList input: CreateListInput! TodoList! Creates list under authenticated owner
updateTodoList input: UpdateListInput! TodoList! Optional optimistic concurrency via expectedVersion
deleteTodoList id: String! Boolean! Deletes owner list, records sync tombstone
createTodoItem input: CreateItemInput! TodoItem! Validates parent list ownership, appends position
updateTodoItem input: UpdateItemInput! TodoItem! Partial update with optional version check
moveTodoItem input: MoveItemInput! TodoItem! Cross-list/in-list move with new position + version bump
deleteTodoItem id: String! Boolean! Deletes owner item, records sync tombstone
pushChanges operations: [SyncOperationInput!]!, idempotencyKey?: String SyncPushResult! Batched sync apply; per-op conflict capture; idempotent replay

Core Types

TodoList

TodoItem

Sync DTOs

Input Validation Rules

Sync & Conflict Semantics

pullChanges(since)

pushChanges(operations, idempotencyKey)

Mutation Flow (Mermaid)

sequenceDiagram
  autonumber
  participant C as Client
  participant G as GraphQL Resolver
  participant S as Domain Service
  participant M as MongoDB
  participant Y as SyncService

  C->>G: Mutation + Bearer JWT
  G->>G: GqlAuthGuard + User decorator
  G->>S: create/update/move/delete
  S->>M: Persist list/item document
  S->>Y: record(ownerId, type, entityId, payload)
  Y->>M: Insert change_log entry
  G-->>C: Updated entity / Boolean / SyncPushResult