GraphQL Queries
Querying the Graph for Architectural Insight and Impact Analysis
Once rescile has built the graph, the primary way to extract information is through its GraphQL API, available
at /graphql. The built-in GraphiQL explorer (at /graphiql) provides auto-complete and schema documentation based
on the resource types generated from your blueprints.
How the Schema is Generated
rescile dynamically generates a GraphQL schema from the resource types present in your graph. Every resource type
(e.g., application, server, database) becomes a top-level query field. You can filter by any property and
traverse relationships directly in the query.
# Fetch all applications owned by team-alpha
query {
application(filter: { owner: "team-alpha" }) {
name
owner
runtime
}
}
Traversing Relationships
Relationships are traversed using nested fields. The response for each related resource is split into two parts:
node— the properties of the connected resource itselfproperties— the properties of the relationship (edge), includingrelation(the edge type) and any compliance enrichment stored on the edge
query ApplicationWithDatabase {
application(filter: { name: "billing-api" }) {
name
database {
properties {
relation # The edge type, e.g. "database" or "CONNECTS_TO"
controls # Compliance properties added to this edge
}
node {
name
type
version
}
}
}
}
Impact Analysis (Blast Radius)
One of the most powerful uses of the graph is determining the blast radius of a failure or change. Traverse from the affected resource outward to see everything that depends on it.
query BillingDatabaseImpact {
# If this database goes down, which applications are affected?
database(filter: { name: "billing-db-prod" }) {
name
application {
node {
name
owner
}
}
}
}
graph TD
subgraph "Blast Radius for billing-db-prod"
DB["database<br><b>billing-db-prod</b>"]
App1["application<br><b>billing-api</b><br>{owner: team-alpha}"]
App2["application<br><b>reporting-service</b><br>{owner: team-gamma}"]
App1 -- "depends on" --> DB
App2 -- "depends on" --> DB
end
Useful Query Patterns
| Pattern | Description |
|---|---|
filter: { name: "..." } |
Filter by any property using exact match |
__typename |
Returns the resource type label of the connected node |
| Nested traversal | Follow any number of relationship hops in a single query |
properties { relation } |
Read the edge type and any edge-level compliance data |
graphJson |
Returns the entire graph as a raw JSON string (useful for exports) |
countNodes |
Returns the total number of nodes in the graph |
For generating outputs and using the REST API, see Retrieving Outputs (REST API).
For automating infrastructure using graph data, see Automation & IaC Integration.