Bulk import not working 500 server error

framework
graphcool-cloud

#1

Type:

type Test @model {
  id: ID! @isUnique
  name: String!
}

Curl command:

curl 'https://api.graph.cool/simple/v1/cjfoi269t3g2q01901wriyi42/import' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer TOKEN' \
-d '{"valueType":"lists","values":[{"_typeName":"Test","name":"importedName"}]}' \
-sSv

#2

Try

-d '{"valueType":"lists","values":[{"_typeName":"Test","name":"importedName","id":"cjfv17i8lfbgr0b26xr5vospa"}]}' \

instead. You forgot to include an id value.


#3

Hi, thank you for your time. :slightly_smiling_face: This is probably not the use case that I am looking for though. Let’s say that I have 10 000 products. Is it possible to import all of them to graphcool? Right now I have to send 10 000 requests everytime I want to create/update the products. Can I do that in bulk somehow?


#4

Yes, have you read the docs: https://www.graph.cool/docs/reference/data-import-and-export/data-import-ol2eoh8xie?


#5

How did forgot to include id value when I don’t have an ID yet? :slight_smile:

This is a command that I put together because I read the documentation:

curl 'https://api.graph.cool/simple/v1/cjfoi269t3g2q01901wriyi42/import' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer TOKEN' \
-d '{"valueType":"lists","values":[{"_typeName":"Test","name":"importedName"}]}' \
-sSv

I don’t want to include ID (or any other optional property) because I expect that graph cool will generate those values?


#6

Every node in Graphcool Framework needs an id. You need to provide an id when importing nodes into Graphcool Framework.