Whoops. Looks like an internal server error. Please contact us from the Console, on `Data import using the raw import API`

framework

#1

Hi I’m trying to use the data import using the raw import API, I’m sending the below curl …

## Request
curl -X "POST" "https://api.graph.cool/simple/v1/civvmhoe91b0q01915qu3osfv/import" \
-H 'Authorization: Bearer ....' \
-H 'Content-Type: application/json' \
-d $'{
"valueType": "nodes",
"values": [
{
"email": "test@test.com",
"id": "0",
"_typeName": "Ticket",
"eventID": "2hjddvdv8dv8dfv8dfv6667d"
},
{
"email": "test1@test1.com",
"id": "1",
"_typeName": "Ticket",
"eventID": "2hjwwwddvde7r7v8dfv6667d"
}
]
}'

and I’m having the next error:

{"requestId":"us-west-2:simple:cjdde4rjqzakq0102w9s6gcsl","error":"Whoops. Looks like an internal server error. Please contact us from the Console (https://console.graph.cool) or via email (support@graph.cool) and include your Request ID: us-west-2:simple:cjdde4rjqzakq0102w9s6gcsl"} 

Can anyone help me? thanks a lot


Unable to import JSON data using graphcool CLI or raw import endpoint
#2

Shouldn’t it say __typename instead of _typename?
Edit: I stand corrected, _typename is correct :slightly_smiling_face:

You can use graphcool export to obtain a valid data set to be imported.


#3

Still I’m facing the same error.
My model is,
type User @model {
id: ID! @isUnique
name: String
}

I created a data using API and exported it. When I export the data, inside node folder, I got the below values,

{“valueType”:“nodes”,“values”:[{“name”:“one”,“updatedAt”:“2018-09-05T07:51:36.000Z”,"_typeName":“User”,“id”:“cjlougk190udt0103d0ma1ebx”,“createdAt”:“2018-09-05T07:51:36.000Z”}]}

For importing I used the same and modified the id and name.

The curl command which I imported in postman is,

curl ‘https://api.graph.cool/simple/v1/cjloudq1q11t801152908eori/import
-H ‘Content-Type: application/json’
-H ‘Authorization: Bearer …’
-d ‘{“valueType”:“nodes”,“values”:[{"_typeName":“User”,“id”:“cjlougk190udt0103d0ma1ekx”,“name”:“one”,“updatedAt”:“2017-11-29 14:35:13”,“createdAt”:“2017-11-29 14:35:13”}]}’
-sSv

As per your suggestion, I changed “_typeName” to “_typename” but still I’m getting the same error.

My model doesn’t contain createdAt and updatedAt. Do I have to include it? Even if I excluded those, I’m facing the error.