# Live Loader fails loading Point type from GraphQL schema

**URL:** https://discuss.dgraph.io/t/live-loader-fails-loading-point-type-from-graphql-schema/15441
**Category:** Dgraph
**Created:** [August 31, 2021, 7:02am UTC](https://discuss.dgraph.io/t/live-loader-fails-loading-point-type-from-graphql-schema/15441 "2021-08-31T07:02:19Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![martaver](https://yyz1.discourse-cdn.com/flex007/user_avatar/discuss.dgraph.io/martaver/32/8682_2.png) [@martaver](https://discuss.dgraph.io/u/martaver)
#### Post date: [August 31, 2021, 7:02am UTC](https://discuss.dgraph.io/t/live-loader-fails-loading-point-type-from-graphql-schema/15441/1 "2021-08-31T07:02:20Z")

</div>

## Report a Dgraph Bug

### What version of Dgraph are you using?

> **Dgraph Version**
>
> ```auto
> $ dgraph version
>  
> Dgraph version : v21.03.1
> Dgraph codename : rocket-1
> Dgraph SHA-256 : a00b73d583a720aa787171e43b4cb4dbbf75b38e522f66c9943ab2f0263007fe
> Commit SHA-1 : ea1cb5f35
> Commit timestamp : 2021-06-17 20:38:11 +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 http://discuss.hypermode.com.
> 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.
> 
> ```

### Have you tried reproducing the issue with the latest release?

Yes

### What is the hardware spec (RAM, OS)?

MacOS 16GB, but I’m running the standalone docker image dgraph/dgraph:v21.03.1

### Steps to reproduce the issue (command/config used to run Dgraph).

I am firing up a standalone docker dgraph instance, and pushing the following graphql schema:

```auto
type Building {
    id: String! @id
    location: Point!
}

```

I have a json file representing bulk data I want to import:

```auto
[{"Building.id":"100085724R","Building.location":{"longitude":22.747430860292567,"latitude":60.061069293715555}}]

```

I run the following command to live load the test json file into the standalone dgraph instance:

```auto
docker compose run dgraph-cli dgraph live --files /seed/test.json --zero dgraph:5080 --alpha dgraph:9080 --upsertPredicate "Building.id"

```

### Expected behaviour and actual result.

I expect live loader to import exactly 1 node at Building.id, with a lat/long Point linked to it at Building.location as the Building type.

Instead, dgraph dies badly:

```auto
Running transaction with dgraph endpoint: dgraph:9080
Found 1 data file(s) to process
Processing data file "/seed/test.json"
Error while mutating: Input for predicate "Building.location" of type scalar is uid. Edge: entity:4000004 attr:"\000\000\000\000\000\000\000\000Building.location" value_type:UID value_id:4000005 s.Code Unknown
Error while mutating: Input for predicate "Building.location" of type scalar is uid. Edge: entity:4000004 attr:"\000\000\000\000\000\000\000\000Building.location" value_type:UID value_id:4000005 s.Code Unknown
Error while mutating: Input for predicate "Building.location" of type scalar is uid. Edge: entity:4000004 attr:"\000\000\000\000\000\000\000\000Building.location" value_type:UID value_id:4000005 s.Code Unknown
Error while mutating: Input for predicate "Building.location" of type scalar is uid. Edge: entity:4000004 attr:"\000\000\000\000\000\000\000\000Building.location" value_type:UID value_id:4000005 s.Code Unknown
Error while mutating: Input for predicate "Building.location" of type scalar is uid. Edge: entity:4000004 attr:"\000\000\000\000\000\000\000\000Building.location" value_type:UID value_id:4000005 s.Code Unknown
Error while mutating: Input for predicate "Building.location" of type scalar is uid. Edge: entity:4000004 attr:"\000\000\000\000\000\000\000\000Building.location" value_type:UID value_id:4000005 s.Code Unknown
Error while mutating: Input for predicate "Building.location" of type scalar is uid. Edge: entity:4000004 attr:"\000\000\000\000\000\000\000\000Building.location" value_type:UID value_id:4000005 s.Code Unknown
Error while mutating: Input for predicate "Building.location" of type scalar is uid. Edge: entity:4000004 attr:"\000\000\000\000\000\000\000\000Building.location" value_type:UID value_id:4000005 s.Code Unknown
Error while mutating: Input for predicate "Building.location" of type scalar is uid. Edge: entity:4000004 attr:"\000\000\000\000\000\000\000\000Building.location" value_type:UID value_id:4000005 s.Code Unknown
Error while mutating: Input for predicate "Building.location" of type scalar is uid. Edge: entity:4000004 attr:"\000\000\000\000\000\000\000\000Building.location" value_type:UID value_id:4000005 s.Code Unknown
Error while mutating: Input for predicate "Building.location" of type scalar is uid. Edge: entity:4000004 attr:"\000\000\000\000\000\000\000\000Building.location" value_type:UID value_id:4000005 s.Code Unknown
Error while mutating: Input for predicate "Building.location" of type scalar is uid. Edge: entity:4000004 attr:"\000\000\000\000\000\000\000\000Building.location" value_type:UID value_id:4000005 s.Code Unknown
Error while mutating: Input for predicate "Building.location" of type scalar is uid. Edge: entity:4000004 attr:"\000\000\000\000\000\000\000\000Building.location" value_type:UID value_id:4000005 s.Code Unknown

```

---

<div class="post-metadata">

### Author: ![martaver](https://yyz1.discourse-cdn.com/flex007/user_avatar/discuss.dgraph.io/martaver/32/8682_2.png) [@martaver](https://discuss.dgraph.io/u/martaver)
#### Post date: [August 31, 2021, 7:39am UTC](https://discuss.dgraph.io/t/live-loader-fails-loading-point-type-from-graphql-schema/15441/2 "2021-08-31T07:39:04Z")

</div>

So the following is the correct format for importing a geo in DQL compatible types (the GraphQL types aren’t compatible with live loader)

```auto
[{"Building.id":"100085724R","Building.location":{
  "type": "Point",
  "coordinates": [22.747430860292567,60.061069293715555]
  }}]

```

There should really be some definitive documentation about what types exist in dgraph, what their respective formats are in DGL and GraphQL, and how they can be represented in RDF and JSON.

Very frustrating to have to dig into tutorials to find an answer to this.

EDIT: Actually, this isn’t working either. The values for Building.location got imported as regular predicates. I must have imported them before I applied the graphql schema.

Can someone show me the correct JSON format for the ‘geo’ type so that live loader can correctly read it?

---

<div class="post-metadata">

### Author: ![MichelDiz](https://yyz1.discourse-cdn.com/flex007/user_avatar/discuss.dgraph.io/micheldiz/32/11873_2.png) [@MichelDiz](https://discuss.dgraph.io/u/MichelDiz)
#### Post date: [August 31, 2021, 5:39pm UTC](https://discuss.dgraph.io/t/live-loader-fails-loading-point-type-from-graphql-schema/15441/3 "2021-08-31T17:39:54Z")

</div>

> [@martaver](#):
>
> Can someone show me the correct JSON format for the ‘geo’ type so that live loader can correctly read it?

It is simple. In the predicate with the Geo Type. You should stringify(Escaping method) the geoJson. As far as I remember. It is true that we don’t have any example and also it is rare some user using JSON in that particular case.

It would be something like this

```auto
[{
   "Building.id":"100085724R",
   "Building.location": "{\"type\": \"Point\", \"coordinates\":[22.747430860292567,60.061069293715555]}"
}]

```

---

<div class="post-metadata">

### Author: ![martaver](https://yyz1.discourse-cdn.com/flex007/user_avatar/discuss.dgraph.io/martaver/32/8682_2.png) [@martaver](https://discuss.dgraph.io/u/martaver)
#### Post date: [August 31, 2021, 8:24pm UTC](https://discuss.dgraph.io/t/live-loader-fails-loading-point-type-from-graphql-schema/15441/4 "2021-08-31T20:24:43Z")

</div>

Ah okay, thanks… how would users normally bulk load geo data then? RDFs? What is the correct format for geos in RDF imports, is it also stringified json?

---

<div class="post-metadata">

### Author: ![MichelDiz](https://yyz1.discourse-cdn.com/flex007/user_avatar/discuss.dgraph.io/micheldiz/32/11873_2.png) [@MichelDiz](https://discuss.dgraph.io/u/MichelDiz)
#### Post date: [August 31, 2021, 8:27pm UTC](https://discuss.dgraph.io/t/live-loader-fails-loading-point-type-from-graphql-schema/15441/5 "2021-08-31T20:27:28Z")

</div>

Something like this

```auto
`<%d> <%s> "{'type':'Point', 'coordinates':[%v, %v]}"^^<geo:geojson> .`

```

Or

```auto
_:a <loc> "{'type':'Point','coordinates':[-122.4220186,37.772318]}"^^<geo:geojson> .

```
