Skip to main content

Model object schema

The model object allows you to query information about a particular model in a given job.

Arguments

When querying for a model, the following arguments are available.

Fetching data...

Below we show some illustrative example queries and outline the schema (all possible fields you can query) of the model object.

Example query for finding parent models and sources

The example query below uses the parentsModels and parentsSources fields to fetch information about a model’s parent models and parent sources. The jobID and uniqueID fields are placeholders that you will need to replace with your own values.

{
job(id: 123) {
model(uniqueId: "model.jaffle_shop.dim_user") {
parentsModels {
runId
uniqueId
executionTime
}
parentsSources {
runId
uniqueId
state
}
}
}
}

Example query for model timing

The example query below could be useful if you want to understand information around execution timing on a given model (start, end, completion).

{
job(id: 123) {
model(uniqueId: "model.jaffle_shop.dim_user") {
runId
projectId
name
uniqueId
resourceType
executeStartedAt
executeCompletedAt
executionTime
}
}
}

Example query for column-level information

You can use the following example query to understand more about the columns of a given model. This query will only work if the job has generated documentation; that is, it will work with the command dbt docs generate.

{
job(id: 123) {
model(uniqueId: "model.jaffle_shop.dim_user") {
columns {
name
index
type
comment
description
tags
meta
}
}
}
}

Fields

When querying for a model, the following fields are available:

Fetching data...

0