query_graphql
Fetch infrastructure data from Infrahub using read-only GraphQL queries. Supports relationship traversal and aggregation for complex data retrieval.
Instructions
Execute a read-only GraphQL query against Infrahub — use for reads only, never mutations.
Mutations are rejected at the AST level: use mutate_graphql instead
(available when write mode is enabled). For simple attribute reads, prefer
get_nodes / search_nodes — use GraphQL only when you need relationship
traversal, aggregation, or fields not exposed by the typed tools.
To discover available kinds and their attributes, read the infrahub://schema
resource. If your client does not support MCP resources, call the get_schema
tool instead. For the full GraphQL SDL, read infrahub://graphql-schema.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| query | Yes | GraphQL query string. Only queries are allowed — use mutate_graphql for mutations. | |
| branch | No | Branch to execute the query against. Defaults to None (uses default branch). |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||