curl -X POST \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer your_api_key" \
  -d '{
    "query": "mutation UpdateDataSources($input: DataSourcesUpdateInput!) { dataSourcesUpdate(input: $input) { success error } }",
    "variables": {
      "input": {
        "domainId": "ET_DOMAIN_id-here",
        "tables": [
          {
            "connection_id": "et-connection-id-here",
            "database_name": "analytics_warehouse",
            "schema_name": "customer_intelligence",
            "table_name": "user_accounts"
          },
          {
            "connection_id": "et-connection-id2-here",
            "database_name": "analytics_warehouse",
            "schema_name": "business_metrics",
            "table_name": "subscription_events"
          }
        ],
        "joins": [
          {
            "leftTable": "user_accounts",
            "rightTable": "subscription_events",
            "relationshipType": "ONE_TO_MANY",
            "joinConditions": [
              {
                "leftColumnName": "account_id",
                "rightColumnName": "account_id"
              }
            ]
          }
        ]
      }
    }
  }' \
  https://{ACCOUNT}.askwisdom.ai/graphql
{
  "data": {
    "dataSourcesUpdate": {
      "success": true,
      "error": null
    }
  }
}

Overview

The dataSourcesUpdate mutation updates the data sources configuration for an existing domain by specifying tables and their relationships. This operation allows you to modify which tables are included in a domain and how they are connected through joins.
The input will overwrite any existing data sources that already existed. Treat the input as what the updated state of data sources should look like.

Signature

dataSourcesUpdate(input: DataSourcesUpdateInput!): DataSourcesUpdatePayload!
This mutation can only be executed by an administrator or a data administrator of the specific connection ID.

Arguments

input
DataSourcesUpdateInput!
required
Input object containing data sources update parameters. See DataSourcesUpdateInput.

DataSourcesUpdateInput

domainId
ID!
required
The unique identifier of the domain to update.
tables
[TableInput!]!
required
List of tables to include in the domain. See TableInput.
joins
[JoinInput!]
List of join relationships between tables. See JoinInput.

Response

Returns a DataSourcesUpdatePayload object containing:
error
String
required
Error, if any occurred. null indicates success.
success
Boolean!
required
Whether the update operation completed successfully.

Usage Example

Update a domain’s data sources with tables and their relationships:
mutation UpdateDataSources($input: DataSourcesUpdateInput!) {
  dataSourcesUpdate(input: $input) {
    success
    error
  }
}
curl -X POST \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer your_api_key" \
  -d '{
    "query": "mutation UpdateDataSources($input: DataSourcesUpdateInput!) { dataSourcesUpdate(input: $input) { success error } }",
    "variables": {
      "input": {
        "domainId": "ET_DOMAIN_id-here",
        "tables": [
          {
            "connection_id": "et-connection-id-here",
            "database_name": "analytics_warehouse",
            "schema_name": "customer_intelligence",
            "table_name": "user_accounts"
          },
          {
            "connection_id": "et-connection-id2-here",
            "database_name": "analytics_warehouse",
            "schema_name": "business_metrics",
            "table_name": "subscription_events"
          }
        ],
        "joins": [
          {
            "leftTable": "user_accounts",
            "rightTable": "subscription_events",
            "relationshipType": "ONE_TO_MANY",
            "joinConditions": [
              {
                "leftColumnName": "account_id",
                "rightColumnName": "account_id"
              }
            ]
          }
        ]
      }
    }
  }' \
  https://{ACCOUNT}.askwisdom.ai/graphql
{
  "data": {
    "dataSourcesUpdate": {
      "success": true,
      "error": null
    }
  }
}