jetruby / apollo_upload_server-ruby

MIT License
180 stars 50 forks source link

Using this in 2020 #34

Closed jeffchuber closed 4 years ago

jeffchuber commented 4 years ago

Is anyone using this in production? Specifically in coordination with https://github.com/jaydenseric/apollo-upload-client

If so, it would be awesome if someone could share an example!

The best 2 posts I have found covering this are:

My current issue is: I can get the file to attach when I write the query in Insomnia, but in the browser I can an error: Error: GraphQL error: Variable $file of type Upload! was provided invalid value. Happy to provide more context on this specific bug if someone thinks that would be helpful!

If there is a fix, also happy to help submit it back as a PR (assuming I can figure this out)

fuelen commented 4 years ago

Raising this exception was added here https://github.com/jetruby/apollo_upload_server-ruby/pull/32. It would be great if you inspect type of the incoming value, maybe previous version will help you. There is also related discussion here https://github.com/jetruby/apollo_upload_server-ruby/issues/33, but I think this is not what you're looking for

sguha00 commented 4 years ago

I was able to get it working with the 2nd article (https://rowant.co.uk/uploading-content-react-graphql-rails-and-active-storage/). Make sure that you're using createUploadLink and using it as a terminating link (https://www.apollographql.com/docs/link/overview/#terminating-links). If you post some code, I'd be happy to take a look

jeffchuber commented 4 years ago

I went with a direct uploading strategy instead where my server simply returns POST instructions via Shine. Closing this to keep down the clutter. I do appreciate the responses! Direct just ended up being best for my use case.