Datasets

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.

FieldTypeDescription
nameStringDataset name
projects.connect.idIDID 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.

FieldTypeDescription
datasets.connect.idIDID 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.

FieldTypeDescription
nameStringDataset name
descriptionStringDataset 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.

FieldTypeDescription
deletedBooleanTo delete a dataset, set to true.
mutation UpdateDataset { 
    updateDataset ( 
        where: { 
            id: "<DATASET_ID>" 
        }, 
        data: { 
            deleted: true 
        } 
    ) { 
        id 
    }
}