# Live Loader - Node not creating as expected

**URL:** https://discuss.dgraph.io/t/live-loader-node-not-creating-as-expected/17035
**Category:** Dgraph
**Created:** [March 17, 2022, 6:55pm UTC](https://discuss.dgraph.io/t/live-loader-node-not-creating-as-expected/17035 "2022-03-17T18:55:30Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![MattH](https://yyz1.discourse-cdn.com/flex007/user_avatar/discuss.dgraph.io/matth/32/8007_2.png) [@MattH](https://discuss.dgraph.io/u/MattH)
#### Post date: [March 17, 2022, 6:55pm UTC](https://discuss.dgraph.io/t/live-loader-node-not-creating-as-expected/17035/1 "2022-03-17T18:55:30Z")

</div>

## What I want to do

I have a GraphQL schema, with a node type for “Country”, defined as:

```auto
type Country {
    country_code: String! @id @search(by: [exact])
    country_name: String @search(by: [exact])
}

```

I loaded a handful of Nodes successfully using a curl mutation, and now wanted to test adding a new node using Live Loader just to verify that my .json file format is correct.

## What I did

I ran Live Loader from my leader Alpha nodes as:

`dgraph live \ --files /data/1/data/dgraph/sample-data/json/countries1.json \ --alpha localhost:9080 \ --zero <zeroIP>:5080 \ --format json \ --cwd /data/1/data/dgraph \ --log_dir`

My initial .json file looked like this:

```auto
[
  {"country_code":"MEX","country_name":"Mexico"}
]

```

The output of the Live command was:

```auto
Running transaction with dgraph endpoint: localhost:9080
Found 1 data file(s) to process
Processing data file "/data/1/data/dgraph/sample-data/json/countries1.json"
Number of TXs run : 1                                                                    
Number of N-Quads processed : 2
Time spent : 8.392862ms
N-Quads processed per second : 2

```

That seemed to indicate to me that the node created correctly.

Since I have country\_code defined as an xid, I’m expecting that the internal uid will be created automatically.

I then use graphiQL to query the data:

```auto
query MyQuery {
	queryCountry {
  	country_code 
  	country_name
 }
}

```

The query returns, but it only shows the previous nodes created via curl.

**Then I realized that I needed to specify the Node type.** So, I updated my .json file to:

```auto
[
  {"dgraph.type":"Country", "country_code":"MEX", "country_name":"Mexico"}
]

```

I ran Live Loader again, with the result:

```auto
Running transaction with dgraph endpoint: localhost:9080
Found 1 data file(s) to process
Processing data file "/data/1/data/dgraph/sample-data/json/countries1.json"
Number of TXs run : 1                                                                    
Number of N-Quads processed : 3
Time spent : 9.457945ms
N-Quads processed per second : 3

```

Now, when I try running my query again, I get the result:

```auto
{
  "errors": [
    {
      "message": "Non-nullable field 'country_code' (type String!) was not present in result from Dgraph. GraphQL error propagation triggered.",
      "path": [
        "queryCountry",
        7,
        "country_code"
      ]
    }
  ],
  "data": {
    "queryCountry": [
      {
        "country_code": "BRA",
        "country_name": "Brazil"
      },
      {
        "country_code": "IT",
        "country_name": "Italy"
      },
      {
        "country_code": "ISR",
        "country_name": "Israel"
      },
      {
        "country_code": "CAN",
        "country_name": "Canada"
      },
      {
        "country_code": "AUS",
        "country_name": "Australia"
      },
      {
        "country_code": "FRA",
        "country_name": "France"
      },
      {
        "country_code": "UK",
        "country_name": "United Kingdom"
      },
      null
    ]
  }
}

```

I dropped all of the data to remove any bad data from previous attempts, re-loaded the Country nodes again via curl, tried the Live command again, but still get the non-nullable field error.

By the way, when I try to specify the --schema flag on the Live command, I receive an error about the ‘@’ character - **“Expected new line after field declaration. Got @”**

What am I doing wrong here?

Thanks in advance!

## Dgraph metadata

> **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

---

<div class="post-metadata">

### Author: ![MattH](https://yyz1.discourse-cdn.com/flex007/user_avatar/discuss.dgraph.io/matth/32/8007_2.png) [@MattH](https://discuss.dgraph.io/u/MattH)
#### Post date: [March 18, 2022, 2:39pm UTC](https://discuss.dgraph.io/t/live-loader-node-not-creating-as-expected/17035/2 "2022-03-18T14:39:02Z")

</div>

Figured it out. The predicate names need to prefaced with the object type, such as:

> [@MattH](#):
>
> ```auto
> [
> {"dgraph.type":"Country", "Country.country_code":"MEX", "Country.country_name":"Mexico"}
> ]
> 
> ```
