related issues on git seem really old. client is l...
# prisma-whats-new
i
related issues on git seem really old. client is lokka from import util. Error is being thrown by node fetch
Copy code
name: 'FetchError',
  message: 'request to <https://api.graph.cool/simple/v1/cj3u93fcco8sy0154c4dozdrz> failed, reason: getaddrinfo ENOTFOUND api.graph.cool api.graph.cool:443',
  type: 'system',
  errno: 'ENOTFOUND',
  code: 'ENOTFOUND' }
a
@idkjsx Stupid question from me, can you access the api from the browser (e.g. click the link). Works from here...
i
not a stupid question.
I can access it. seems like that is the error it throws when it doesnt like the import code.
i had a typo in the code.
having said that, the script always errors out, even when it does the import.
for example, just now
Copy code
…/utils/advanced-import  node --harmony-async-await import-books.js                                                                                              ✓  4728  19:33:52 
{ Error
    at ClientRequest.<anonymous> (/Users/devworx/code/APOLLO/apollo-recompose/utils/advanced-import/node_modules/node-fetch/index.js:133:11)
    at emitOne (events.js:96:13)
    at ClientRequest.emit (events.js:191:7)
    at TLSSocket.socketErrorListener (_http_client.js:358:9)
    at emitOne (events.js:96:13)
    at TLSSocket.emit (events.js:191:7)
    at emitErrorNT (net.js:1283:8)
    at _combinedTickCallback (internal/process/next_tick.js:80:11)
    at process._tickCallback (internal/process/next_tick.js:104:9)
  name: 'FetchError',
  message: 'request to <https://api.graph.cool/simple/v1/cj3u93fcco8sy0154c4dozdrz> failed, reason: socket hang up',
  type: 'system',
  errno: 'ECONNRESET',
  code: 'ECONNRESET' }
though i can only get some of the data in
a
By the way, it seems the default import script creates a seperate mutation for each record. You're probably running into server throttling, @nilan might know more...
Or running out of available sockets
i
i was just thinking that while getting the kids in the tub. So how do i stop that?
n
you can try two things: throttling your mutations (don't run them too quickly in a row) and simply catching the error of a mutation and retry it
i
so this script isnt designed for more than a few records then.
n
not sure what you mean. With a script like that you can import thousands of nodes
i
Good info. Let me look at it again. Thanks.