A Dataset is a collection of Data Rows and can span multiple Projects. For a complete list of fields for Dataset, visit the Docs tab in the API explorer.
Create a Dataset
Use the createDataset
mutation to create a dataset and connect it to a project.
Field | Type | Description |
---|---|---|
name | String | Dataset name |
projects.connect.id | ID | ID of the project to connect the dataset to |
mutation CreateDataset {
createDataset (
data: {
name: "<DATASET_NAME>",
projects: {
connect: {
id: "<PROJECT_ID>"
}
}
}
) {
id
}
}
Attach a Dataset
Use the updateProject
mutation to connect an existing dataset to a project.
Field | Type | Description |
---|---|---|
datasets.connect.id | ID | ID of the dataset to connect to the project |
mutation AttachDataset {
updateProject (
where: {
id:"<PROJECT_ID>"
},
data:{
datasets: {
connect: {
id: "<DATASET_ID>"
}
}
}
){
id
}
}
Get a Dataset
Use the dataset
query to get a dataset by id. For a complete list of Dataset fields, see the Docs tab in the API explorer.
query GetDataset {
dataset (where: {id: "<DATASET_ID>"}) {
name
description
projects {
id
}
createdAt
createdBy {
id
}
rowCount
}
}
Update a Dataset
Use the updateDataset
mutation to update dataset fields.
Field | Type | Description |
---|---|---|
name | String | Dataset name |
description | String | Dataset description |
mutation UpdateDataset {
updateDataset (
where: {
id: "<DATASET_ID>"
},
data: {
name: "<NEW_NAME>",
description: "<NEW_DESCRIPTION>"
}
) {
id
}
}
Delete a Dataset
Use the updateDataset
mutation to delete dataset fields.
Field | Type | Description |
---|---|---|
deleted | Boolean | To delete a dataset, set to true . |
mutation UpdateDataset {
updateDataset (
where: {
id: "<DATASET_ID>"
},
data: {
deleted: true
}
) {
id
}
}