Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
export const createDataset = (client, dir) => {
const label = path.basename(dir)
return client
.mutate({
mutation: datasets.createDataset,
variables: { label },
})
.then(({ data }) => {
const dsId = data.createDataset.id
// eslint-disable-next-line no-console
console.log(`"${dsId}" created with label "${label}"`)
return dsId
})
}
export const createDataset = client => label => {
return client
.mutate({
mutation: datasets.createDataset,
variables: { label },
errorPolicy: 'all',
})
.then(({ data }) => data.createDataset.id)
}