Mutate Graphql
mutate_graphqlExecute GraphQL mutations on the active Infrahub session branch for relationship edits, bulk operations, or write shapes the typed tools cannot express.
Instructions
Execute a GraphQL mutation against Infrahub — use only for complex writes that typed tools can't express.
Prefer node_upsert (create/update scalar attributes) or node_delete
(remove a node) for straightforward changes; they validate against the
schema and produce clearer audit entries. Reach for mutate_graphql
when you need relationship edits, bulk operations, or any mutation shape
not covered by the typed tools. For reads, use query_graphql.
The mutation always runs on the active session branch (auto-created on the
first write of the session, mcp/session-YYYYMMDD-<hex>). There is no branch
override — writes are isolated to the session, and changes reach the default
branch only through propose_changes and human review. To target a different
branch deliberately, switch the session with reset_session_branch first.
Branch- and schema-management mutations are rejected.
To discover available kinds and their attributes, read the infrahub://schema
resource or call the get_schema tool.
For the full GraphQL SDL, read infrahub://graphql-schema.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"query": "<query>"
},
"name": "mutate_graphql"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| query | Yes | GraphQL mutation to execute on the active session branch. |