API Exposure Guide

The GraphQL Interface

Interacting with the Rescile controller via GraphQL for querying, traversal, and global queries.

The GraphQL Interface

The primary way to extract information from Rescile is through its dynamically generated GraphQL API, available at /graphql. The built-in GraphiQL explorer (at /graphiql) provides auto-complete and schema documentation based directly on the resource types present in your graph.

Querying and Traversal

Every resource type (e.g., server, application, database) is automatically exposed as a top-level query field. You can filter by any property and deeply traverse relationships (edges) in a single request.

When traversing relationships, the response is split to provide both edge metadata and the target node’s properties:

  • node: The properties of the connected target resource.
  • properties: The properties of the relationship (edge), including the relation type and any compliance controls.
query BlastRadiusAnalysis {
  database(filter: { name: "billing-db-prod" }) {
    name
    environment
    # Traverse relationships backward to find dependent applications
    application {
      properties {
        relation
      }
      node {
        name
        owner
      }
    }
  }
}

Global & Utility Queries

Beyond standard resource queries, Rescile provides several top-level queries to inspect the graph structure and perform pathfinding:

  • Graph Statistics:
    • countNodes: Total number of nodes (vertices).
    • countEdges: Total number of relationships (edges).
    • countResourceTypes: Total number of unique node labels.
    • countRelationTypes: Total number of unique edge labels.
    • countNodeProperties / countEdgeProperties: Total properties across the graph.
  • Introspection:
    • listNodes(label: "server"): Returns all node types and their primary keys.
  • Pathfinding:
    • findPaths(startLabel: "server", startName: "web-01", endLabel: "database"): Executes a breadth-first search to find all unique paths between a specific starting resource and any resource of a target type.
  • Raw Export:
    • graphJson: Returns the entire underlying graph as a raw JSON string.