mutate_graphql
Perform GraphQL mutations on Infrahub for complex writes such as relationship edits or bulk operations that simple typed tools cannot handle.
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 targets the session branch by default, which is auto-created
on the first write of the session (mcp/session-YYYYMMDD-<hex>).
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. | |
| branch | No | Branch to execute the mutation against. Defaults to the auto-created session branch (recommended). Override only when targeting a specific non-default branch. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||