Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release note: changes to Discovery API endpoints #4005

Merged
merged 7 commits into from
Aug 31, 2023
Original file line number Diff line number Diff line change
@@ -0,0 +1,126 @@
---
title: "Query patterns and endpoints in the dbt Cloud Discovery API"
nghi-ly marked this conversation as resolved.
Show resolved Hide resolved
nghi-ly marked this conversation as resolved.
Show resolved Hide resolved
description: "August 2023: Learn about the upcoming deprecation of certain endpoints and query patterns in the Discovery API."
sidebar_position: 6
sidebar_label: "Deprecation: Certain Dicovery API endpoints and query patterns"
tags: [Aug-2023, API]
date: 2023-08-31
---

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](/docs/dbt-cloud-apis/discovery-api).
nghi-ly marked this conversation as resolved.
Show resolved Hide resolved

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](mailto:[email protected]) with any questions. We're here to help you during this transition period.
nghi-ly marked this conversation as resolved.
Show resolved Hide resolved

## 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](https://metadata.cloud.getdbt.com/graphql). 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:

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

Example of query after deprecation:

```graphql
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:

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

Example of query after deprecation:

```graphql
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 has 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:

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


Example of query after deprecation:

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


Loading