Skip to content

Instantly share code, notes, and snippets.

@mjpitz
Last active May 29, 2021 00:58
Show Gist options
  • Save mjpitz/0df6fd7982129ed620100423ced921ef to your computer and use it in GitHub Desktop.
Save mjpitz/0df6fd7982129ed620100423ced921ef to your computer and use it in GitHub Desktop.
dgraph troubles

Three files:

  • schema.gql contains the type definitions I inserted into dgraph.
  • seed.rdf contains the set definition used to populate the database with associated information.
  • query.gql contains the dql query I'm trying to execute based on the examples...

When I run the query I get no results back. I've tried this at all sorts of different parts of the simple tree. Can't get any information anywhere. Can see data stored in the system just can't access it. Docs to the system aren't great. They reference a lot of things that seem deprecated / unavailable and the server doesn't return super useful error messages. (e.g. "undefined directive index" and yet, they use it everywhere.)

Version information

docker - dgraph/dgraph:latest

Dgraph version   : v21.03.0
Dgraph codename  : rocket
Dgraph SHA-256   : b4e4c77011e2938e9da197395dbce91d0c6ebb83d383b190f5b70201836a773f
Commit SHA-1     : a77bbe8ae
Commit timestamp : 2021-04-07 21:36:38 +0530
Branch           : HEAD
Go version       : go1.16.2
jemalloc enabled : true

For Dgraph official documentation, visit https://dgraph.io/docs.
For discussions about Dgraph     , visit https://discuss.dgraph.io.
For fully-managed Dgraph Cloud   , visit https://dgraph.io/cloud.

Licensed variously under the Apache Public License 2.0 and Dgraph Community License.
Copyright 2015-2021 Dgraph Labs, Inc.

docker - dgraph/ratel:latest

Ratel Version: 20.7.0
Commit ID: 
Commit Info: 
query {
cloud(func: eq(cloud.name, "aws")) {
name
regions {
name
zones {
name
}
}
}
}
type Cloud @dgraph(type: "cloud") {
id: ID!
name: String! @id
regions: [Region!]! @hasInverse(field: cloud)
}
type Region @dgraph(type: "region") {
id: ID!
name: String! @id
cloud: Cloud!
zones: [Zone!]! @hasInverse(field: region)
}
type Zone @dgraph(type: "zone") {
id: ID!
name: String! @id
cloud: Cloud!
region: Region!
}
{
set {
_:aws <dgraph.type> "cloud" .
_:aws <cloud.name> "aws" .
_:us-west-1 <dgraph.type> "region" .
_:us-west-1 <region.name> "us-west-1" .
_:us-west-1 <region.cloud> _:aws .
_:us-west-1a <dgraph.type> "zone" .
_:us-west-1a <zone.name> "us-west-1a" .
_:us-west-1a <zone.region> _:us-west-1 .
_:us-west-1b <dgraph.type> "zone" .
_:us-west-1b <zone.name> "us-west-1b" .
_:us-west-1b <zone.region> _:us-west-1 .
_:us-west-1c <dgraph.type> "zone" .
_:us-west-1c <zone.name> "us-west-1c" .
_:us-west-1c <zone.region> _:us-west-1 .
}
}
@danielmai
Copy link

@mjpitz Awesome! Glad to hear that you have this running now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment