Brain Docs

Reference

TypeScript SDKInstallationHTTP clientWire client
getSchemavalidateSchemauploadSchemareplaceSchemadropSchemalistSchemaslistExtractors
ErrorsRetriesPagination
Brain/Docs
✦ ASKBrain on GitHubDashboard
TypeScript SDKSchemadropSchema

dropSchema

Remove one declaration — and find out how many live rows still depend on it.

PURPOSE

Remove one declaration — an entity type, a predicate, a relation type — rather than the whole document.

DELETE/v1/schema/:kind/:nameBearer API keystable
dropSchema(kind: string, name: string, query?: DropSchemaQuery): Promise<DropSchemaResult>
Handshake credentialstable
dropSchema(request: SchemaDropRequest): Promise<SchemaDropResponse>

Parameters

ParameterTypeRequired
kindstringrequired

What is being dropped. A path segment on the HTTP tier.

namestringrequired

Its name. Also a path segment.

forcebooleanoptional

Drop it even though rows still use it.

Returns

FieldTypePresence
droppedbooleanalways

Whether it was removed. false with a non-zero liveRows is the refusal: rows still use the declaration and force was not set.

liveRowsintegeralways

How many rows depend on it. Check this before retrying with force — it is the number of rows that retry would orphan.

namespace / schemaVersion / targetKind / targetName—always

What was targeted.

validationErrorsSchemaError[]always

Populated when the drop would leave the schema invalid.

Validation failures are not exceptions

This verb resolves with a populated validationErrors array rather than throwing. Code that only wraps the call in a try/catch treats an invalid schema as a successful one. Check the array.

See also
replaceSchemagetSchema

Was this page helpful?

replaceSchema

Replace the schema wholesale — and read the count of live rows it destroyed.

listSchemas

Every schema version in the namespace, and whether each one kept its source text.

On this page

ParametersReturns
Suggest an editOpen in Playground