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>" }
}