mutate_graphql
Execute complex GraphQL mutations on Infrahub for writes that typed tools cannot handle, such as relationship edits or bulk operations. Runs on the active session branch for isolated changes.
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.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| query | Yes | GraphQL mutation to execute on the active session branch. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||