Skip to content

Quickstart

MichaelJCompton edited this page Apr 15, 2019 · 2 revisions

GraphSchema.io Quick Start

Deploy a Dgraph Instance

It takes just one GraphQL mutation to spin up a Dgraph instance.

E.G, if you know the id of your environment, the GraphQL mutation

mutation addDgraphInstance($dgInput: DgraphInstanceInput!) {
  addDgraphInstance(inputData: $dgInput) {
    id
  }
}

with some input data about the instance you want

{
  "dgInput": {
    "replicas": 1,
    "shards": 1,
    "storageGB": 3,
    "env": {
      "id": "0x7"
    }
  }
}

spins you up a Dgraph instance. Once the instance is up, you can get its details and credentials via

query getDgraphInstance($dgInput: ID!) {
  getDgraphInstance(id: $dgInput) {
    dgraphId
    address
    certificates {
      caCert
      clientCert
      clientKey
    }
  }
}

After that, it's connecting the instance via secured grpc and you are on your way.

Destroy a Dgraph Instance

Just

mutation deleteDgraphInstance($instance: ID!) {
  deleteDgraphInstance(inputData: $instance)
}

and it's gone.