https://www.prisma.io/ logo
Join SlackCommunities
Powered by
# random
  • p

    ppatidar

    05/23/2017, 8:45 AM
    @nilan can you please tell me why i'mgetting this error and how can remove this error "message": "Cannot return null for non-nullable type (line 4, column 5):\n sport{id}\n ^", allCoacheAcadmics { id sport{id} } }
    🔴 1
    n
    • 2
    • 7
  • m

    martin

    06/16/2017, 4:22 PM
    Sorry to make a political post here… it seems appropriate. Former German chancellor Helmut Kohl has passed; without passing a judgment on him as a person or his political views, I can hardly think of anyone more responsible for seizing the opportunity for German reunification (and thus, probably allowing for graphcool’s existence in the first place in a unified Berlin). http://www.spiegel.de/politik/deutschland/helmut-kohl-ist-laut-bild-tot-a-1152553.html
    👍 5
  • s

    samuell

    06/29/2017, 1:52 PM
    Anybody have experience with saving files with fs?
    m
    • 2
    • 9
  • s

    samuell

    06/29/2017, 1:53 PM
    i using this to save files but pdf are saved and corrupted
    fs.writeFileSync(targetPath, new Buffer(response.data, 'base64'))
  • s

    samuell

    06/29/2017, 1:53 PM
    for downloading from url i using
    axios
  • a

    agartha

    06/29/2017, 1:55 PM
    Is the response base64 encoded?
  • s

    samuell

    06/29/2017, 1:55 PM
    i found images are saved fine but pdfs are corrupted
  • a

    agartha

    06/29/2017, 1:56 PM
    I would try 'binary' instead of 'base64'
  • a

    agartha

    06/29/2017, 1:56 PM
    I don't think PDF contents use base64 encoding
  • s

    samuell

    06/29/2017, 1:56 PM
    arraybuffer?
  • a

    agartha

    06/29/2017, 1:56 PM
    no, in your line of code
  • s

    samuell

    06/29/2017, 1:57 PM
    i can try
  • a

    agartha

    06/29/2017, 1:58 PM
    I would also use createWriteStream and just pipe the response
  • s

    samuell

    06/29/2017, 1:58 PM
    file is saved but doesnt show up
  • a

    agartha

    06/29/2017, 1:59 PM
    Like the axios example from:
    Copy code
    // GET request for remote image
    axios({
      method:'get',
      url:'<http://bit.ly/2mTM3nY>',
      responseType:'stream'
    })
      .then(function(response) {
      response.data.pipe(fs.createWriteStream('ada_lovelace.jpg'))
    });
  • a

    agartha

    06/29/2017, 2:00 PM
    Source: https://github.com/mzabriskie/axios#axios-api
  • s

    samuell

    06/29/2017, 2:02 PM
    response.data.pipe is not a function
  • a

    agartha

    06/29/2017, 2:02 PM
    you used
    responseType: 'stream'
    ?
  • s

    samuell

    06/29/2017, 2:03 PM
    yes there is some warning
    The provided value 'stream' is not a valid enum value of type XMLHttpRequestResponseType.
  • a

    agartha

    06/29/2017, 2:06 PM
    running in browser or node?
  • s

    samuell

    06/29/2017, 2:07 PM
    browser
  • a

    agartha

    06/29/2017, 2:07 PM
    Aaahh...
  • s

    samuell

    06/29/2017, 2:07 PM
    electron + vue
  • a

    agartha

    06/29/2017, 2:08 PM
    And writing response.data directly without wrapping in Buffer doesn't work?
  • s

    samuell

    06/29/2017, 2:16 PM
    its saving good
  • s

    samuell

    06/29/2017, 2:16 PM
    but files are corrupted
  • a

    agartha

    06/29/2017, 2:20 PM
    I wouldn't know, first guess was the base64 encoding, I would have thought it would work with binary.
  • a

    agartha

    06/29/2017, 2:20 PM
    But if not, afraid I don't know then...
  • s

    samuell

    06/30/2017, 8:01 AM
    @agartha maybe i try this https://github.com/kennethjiang/react-file-download/blob/master/file-download.js
  • a

    amr

    07/01/2017, 1:12 PM
    Next week will have the kickoff meetup of graphql meetup in Budapest:) https://www.meetup.com/Budapest-GraphQL/events/240754848/
    🎉 3
1...567...53Latest