Automatic Asset Mutations (Auto-CRUD)
Whenever Rescile detects a known asset type (either a .csv file exists or its schema is defined via a module.toml), it automatically generates item-level mutation endpoints.
These endpoints replace raw string/CSV manipulation with strict JSON/GraphQL type-safety. They enforce mandatory fields, expected data types, and uniqueness constraints.
GraphQL Interface
Rescile auto-generates GraphQL input objects based on the asset’s schema and extends the Mutation type with intent-specific operations: Add<Type>, Change<Type>, and Delete<Type>.
mutation CreateNewVM {
AddVm(input: {
name: "web-server-01",
tenant: "finance",
cores: 4
}) {
success
message
}
}
REST Interface
Dynamic JSON endpoints are automatically mounted for Auto-CRUD operations.
- POST
/api/mutations/:asset(ADD): Inserts a single JSON record. Returns409 Conflictif the primary key already exists. - PUT
/api/mutations/:asset/:name(CHANGE): Merges the provided JSON payload with the existing record. Returns404 Not Foundif the item doesn’t exist. - DELETE
/api/mutations/:asset/:name(DELETE): Deletes the matching record.
Example:
POST /api/mutations/vm
Content-Type: application/json
{
"name": "web-server-01",
"tenant": "finance",
"cores": 4
}