मुख्य सामग्री पर जाएँ

GraphQL API

clepit की GraphQL सतह दस्तावेज़ मॉडल को कवर करती है: वर्कस्पेस, पेज, ब्लॉक, टिप्पणियाँ, खोज, संशोधन और साझाकरण। हर अनुरोध के लिए एक्सेस टोकन चाहिए।

JSON
{
  "method": "POST",
  "url": "https://api.clepit.com/graphql",
  "headers": { "Authorization": "Bearer <access token>" }
}

Playground

A graphical explorer is served at GET /graphql in every environment except production.

https://staging.api.clepit.com/graphql

Reading a page tree

GraphQL
query PageTree($workspaceId: String!) {
  pages(workspaceId: $workspaceId) {
    id
    title
    parentId
    position
  }
}

Saving a document

Blocks are stored generically as type plus data, so a block type the server has never seen round-trips untouched rather than being rewritten.

GraphQL
mutation SaveDocument($id: String!, $blocks: [BlockInput!]!) {
  saveDocument(id: $id, blocks: $blocks) {
    id
    updatedAt
  }
}

Subscriptions

Subscribe over WebSocket at wss://api.clepit.com/graphql/ws

JSON
{
  "type": "connection_init",
  "payload": { "Authorization": "Bearer <access token>" }
}