Is anybody using `apollo-upload-client` with `grap...
# prisma-whats-new
Is anybody using
Yes. 🙂
Do you have an example? I feel like I’m close but can’t quite figure it out.
Are you trying to connect the Apollo upload client to your server?
side comment: it's almost always better to ask the real question right away, and skip the "does anyone" part 🙂 on your question: @martin looked into this recently, I'm sure he can help you out.
👍 1
Yes @martin. I’ll keep that in mind for next time @nilan. My first question would be how I can have both an httplink with auth and an upload link in the apollo client @martin? I can message you directly if you prefer.
there should already be an example, can you share that here @martin?
I’m currently getting
Cannot return null for non-nullable field Mutation.uploadFile.
but I’m able to send the file to the server (in a convoluted way).
I’m on my phone atm on the subway, so it’s kinda hard for me to read code on this small screen. But I did this for a couple of hours ago:
😄 1
So yea, you can both have httplink and Auth! 😄
Awesome 🙂 I’ll take a look and let you know!
Cool dude. I’ll be on my computer in 20 mins. If the problem still remains, we can chat more detailed then
Tagging in for updates 🙂
👀 2
@manticarodrigo by the way, are you being able to store your files in a directory somewhere?
I’m using a module that uploads the files to fake s3 on a local docker container. I had it working already from client side with fetch but I want to process everything through graphql on server if possible
Your server-side implementation would be nice to see 😄
The authLink with upload is working 😄
Cool to hear that it’s working! Yeah sure I have it on GitHub. Some files are worth looking at. I’ll leave the link here for know so you can check it out yourself. I’m home soon
Awesome! Thanks again
So I’m able to get the file on the server with it’s stream, filename, mimetype, and encoding. Now I need it converted into a format for Prisma with a name, secret, size, body, and contentType to upload on S3 client. Any ideas on how to accomplish this?
Prisma doesn't have a built-in concept for File handling.
I assume you are referring to This is only an example, nothing set in stone.
Thanks @nilan. I’m trying to write my own implementation but can’t figure out what time of file object I’m getting on server side.
Does anybody know what this is :
Copy code
{ stream: 
   FileStream {
      ReadableState {
        objectMode: false,
        highWaterMark: 16384,
        buffer: [BufferList],
        length: 65023,
        pipes: null,
        pipesCount: 0,
        flowing: null,
        ended: false,
        endEmitted: false,
        reading: false,
        sync: true,
        needReadable: false,
        emittedReadable: false,
        readableListening: false,
        resumeScheduled: false,
        destroyed: false,
        defaultEncoding: ‘utf8’,
        awaitDrain: 0,
        readingMore: false,
        decoder: null,
        encoding: null },
     readable: true,
     domain: null,
     _events: { end: [Array], limit: [Function] },
     _eventsCount: 2,
     _maxListeners: undefined,
     truncated: false,
     _read: [Function] },
  filename: ‘edumate.png’,
  mimetype: ‘image/png’,
  encoding: ‘7bit’ }
Would you mind describing your situation in a new thread here: 🙂
That's a node stream
Thanks @lawjolla . Sorry for the spam @nilan. I’ve almost figured it out. If anyone is interested in a apollo-upload-server/client implementation of file handling for s3 let me know. I’m almost there.
💯 1
awesome! 😄
Looks like we should improve our example, or add a new one as well. Curious to see what you end up with then! 🙂
I'm working on an image resizer today. (Image upload -> resizes -> S3 (DO Spaces, actually 🙂 ) -> Prisma with the meta data)
👀 1
Everyone is so hardcore 😮
🚀 1