Skip to main content

Deprecation: Query patterns and endpoints in the dbt Cloud Discovery API

dbt Labs has deprecated and will be deprecating certain query patterns and replacing them with new conventions to enhance the performance of the dbt Cloud Discovery API.

All these changes will be in effect on September 7, 2023.

We understand that these changes might require adjustments to your existing integration with the Discovery API. Please contact us with any questions. We're here to help you during this transition period.

Job-based queries

Job-based queries that use the data type Int for IDs will be deprecated. They will be marked as deprecated in the GraphQL explorer. The new convention will be for you to use the data type BigInt instead.

This change will be in effect starting September 7, 2023.

Example of query before deprecation:

query ($jobId: Int!) {
models(jobId: $jobId){
uniqueId
}
}

Example of query after deprecation:

query ($jobId: BigInt!) {
job(id: $jobId) {
models {
uniqueId
}
}
}

modelByEnvironment queries

The modelByEnvironment object has been renamed and moved into the environment object. This change is in effect and has been since August 15, 2023.

Example of query before deprecation:

query ($environmentId: Int!, $uniqueId: String) {
modelByEnvironment(environmentId: $environmentId, uniqueId: $uniqueId) {
uniqueId
executionTime
executeCompletedAt
}
}

Example of query after deprecation:

query ($environmentId: BigInt!, $uniqueId: String) {
environment(id: $environmentId) {
applied {
modelHistoricalRuns(uniqueId: $uniqueId) {
uniqueId
executionTime
executeCompletedAt
}
}
}
}

Environment and account queries

Environment and account queries that use Int as a data type for ID have been deprecated. IDs must now be in BigInt. This change is in effect and has been since August 15, 2023.

Example of query before deprecation:

query ($environmentId: Int!, $first: Int!) {
environment(id: $environmentId) {
applied {
models(first: $first) {
edges {
node {
uniqueId
executionInfo {
lastRunId
}
}
}
}
}
}
}

Example of query after deprecation:

query ($environmentId: BigInt!, $first: Int!) {
environment(id: $environmentId) {
applied {
models(first: $first) {
edges {
node {
uniqueId
executionInfo {
lastRunId
}
}
}
}
}
}
}
0