Skip to main content

CRUD

Write operations (create, update, patch, delete) require Draft endpoints. Read operations work on any endpoint — HEAD, Draft, or specific revision. For table management (create/delete tables, rename, schema changes), see System API.

All examples use this schema

Table products:

{
"type": "object",
"properties": {
"title": { "type": "string", "default": "" },
"price": { "type": "number", "default": 0 },
"inStock": { "type": "boolean", "default": false }
},
"required": ["title", "price", "inStock"],
"additionalProperties": false
}

Create Row

# Draft endpoint only
mutation {
createProduct(data: {
id: "iphone-16"
data: { title: "iPhone 16 Pro", price: 999 }
}) {
id
data { title price }
}
}

Create Rows (Bulk)

Not yet available in Generated GraphQL.

# Draft endpoint only
POST /endpoint/rest/<org>/<project>/<branch>/draft/tables/products/rows/bulk
Content-Type: application/json

{
"rows": [
{ "rowId": "iphone-16", "data": { "title": "iPhone 16 Pro", "price": 999 } },
{ "rowId": "macbook-m4", "data": { "title": "MacBook M4", "price": 1999 } }
]
}

Get Single Row

query {
product(id: "iphone-16") {
id
createdAt
data { title price }
}
}

Flat variant (data fields only):

query {
productFlat(id: "iphone-16") {
title
price
}
}

List Rows

query {
products(data: {
first: 20
where: { data: { path: ["price"], gte: 100 } }
orderBy: [{ data: { path: "price", direction: "desc", type: "float" } }]
}) {
edges {
node { id data { title price } }
cursor
}
pageInfo { hasNextPage endCursor }
totalCount
}
}

Flat variant (data fields only, no metadata):

query {
productsFlat(data: { first: 20 }) {
edges {
node { title price inStock }
}
totalCount
}
}

See Filtering, Sorting, and Pagination for full query syntax.

Update Row

Update replaces the entire row data. For partial updates, see Patch Row.

# Draft endpoint only
mutation {
updateProduct(data: {
id: "iphone-16"
data: { title: "iPhone 16 Pro Max", price: 1199 }
}) {
id
data { title price }
}
}

Update Rows (Bulk)

Not yet available in Generated GraphQL.

# Draft endpoint only
PUT /endpoint/rest/<org>/<project>/<branch>/draft/tables/products/rows/bulk
Content-Type: application/json

{
"rows": [
{ "rowId": "iphone-16", "data": { "title": "iPhone 16 Pro", "price": 1099 } },
{ "rowId": "macbook-m4", "data": { "title": "MacBook M4 Pro", "price": 2499 } }
]
}

Patch Row

Partial update using JSON Patch. Only the replace operation is supported.

# Draft endpoint only
PATCH /endpoint/rest/<org>/<project>/<branch>/draft/tables/products/row/iphone-16
Content-Type: application/json

{
"patches": [
{ "op": "replace", "path": "price", "value": 1099 }
]
}

Path Syntax

Path points to the field you want to change — without leading slash:

PathTarget
"price"Top-level field
"specs.weight"Nested object field
"items[0].name"First array element's field
"items[2].price"Third array element's field

Examples

// Update a top-level field
{ "op": "replace", "path": "title", "value": "iPhone 16 Pro Max" }

// Update a nested field
{ "op": "replace", "path": "specs.weight", "value": 227 }

// Update a field inside an array item
{ "op": "replace", "path": "items[0].quantity", "value": 20 }

// Update multiple fields at once
[
{ "op": "replace", "path": "price", "value": 1099 },
{ "op": "replace", "path": "inStock", "value": true }
]

Patch Rows (Bulk)

Not yet available in Generated GraphQL.

# Draft endpoint only
PATCH /endpoint/rest/<org>/<project>/<branch>/draft/tables/products/rows/bulk
Content-Type: application/json

{
"rows": [
{ "rowId": "iphone-16", "patches": [{ "op": "replace", "path": "price", "value": 1099 }] },
{ "rowId": "macbook-m4", "patches": [{ "op": "replace", "path": "price", "value": 2499 }] }
]
}

Patch Limitations

  • Only the replace operation is supported — no add, remove, or move
  • Path uses dot notation and bracket notation, not JSON Pointer (/) syntax
  • The field must exist in the schema

Delete Row

# Draft endpoint only
mutation {
deleteProduct(id: "iphone-16") {
id
success
}
}
note

Cannot delete a row that is referenced by foreign keys in other rows. Remove the FK references first.

Delete Rows (Bulk)

Not yet available in Generated GraphQL.

# Draft endpoint only
DELETE /endpoint/rest/<org>/<project>/<branch>/draft/tables/products/rows/bulk
Content-Type: application/json

{ "rowIds": ["old-product-1", "old-product-2", "old-product-3"] }