How to use the openneuro-client.datasets.createDataset function in openneuro-client

To help you get started, we’ve selected a few openneuro-client examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github OpenNeuroOrg / openneuro / packages / openneuro-cli / src / datasets.js View on Github external
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
    })
}
github OpenNeuroOrg / openneuro / packages / openneuro-app / src / scripts / uploader / upload-mutation.js View on Github external
export const createDataset = client => label => {
  return client
    .mutate({
      mutation: datasets.createDataset,
      variables: { label },
      errorPolicy: 'all',
    })
    .then(({ data }) => data.createDataset.id)
}