Table of Contents

Datasets

Alex Cota Updated by Alex Cota

A dataset is a collection of data rows and can span multiple projects.

Below are some common operations the GraphQL API supports for datasets.

Create a dataset

mutation CreateDataset { 
createDataset (
data: {
name: "dataset name",
projects: {connect: {id: "ck6cib5zmmy3g0842s3bdkl6t"}},
}
) {
id
}
}

Attach a dataset

mutation AttachDataset{ 
updateProject(
where:{
id:"ck6cib5zmmy3g0842s3bdkl6t"
},
data:{
setupComplete: "2018-11-29T20:46:59.521Z",
datasets:{
connect:{
id: "ck52rvx4ombr80853k1ccx1s2"
}
}
}
){
id
}
}

Get a dataset

query GetDataset { 
dataset (where: {id: "ck7us46zn1ial0807z9esamua" }) {
name
description
projects {
id }
createdAt
createdBy {
id
}
rowCount
}
}

Update a dataset

mutation UpdateDataset { 
updateDataset(
where: {
id: "ck52rvx4ombr80853k1ccx1s2" },
data: {
name: "new name",
description: "new description"
}
) {
id
}
}

Delete a dataset

mutation UpdateDataset { 
updateDataset(
where: {
id: "ck52rvx4ombr80853k1ccx1s2"
},
data: {
deleted: true
}
) {
id
}
}

Was this page helpful?

Project setup

Data Rows

Contact