Stylianos Gakis
10/11/2023, 12:00 PMbod
10/11/2023, 12:10 PMStylianos Gakis
10/11/2023, 12:11 PMbod
10/11/2023, 12:12 PMthe behavior might wanna stay in apollo-kotlin, since non-apollo-router implementations support this just fineyou're probably right, maybe just a warning about it not being supported by router + a link to the blog post. Looks like it may have security concerns.
Stylianos Gakis
10/11/2023, 12:13 PMmbonnin
10/11/2023, 12:21 PMStylianos Gakis
10/11/2023, 12:31 PMCall you favorite HTTP client instead of using GraphQLIdontwanna 😂 But jokes aside, we did actually have to do this once before, because some service was using netflix DGS + WebFlux which surprise surprise, also does not support the Upload scalar. That was for audio files in that scenario. Now we’ll just do the same, but for file uploads, and to a different service. The way we had it before, is that we initiated the process with a HTTP request there, and we got back a unique ID back. Then GQL receives in a mutation just that ID, which we only get back if the process succeeded already. It will work here too, and you are right, it’s not that hard to do. It is what it is 😄
mbonnin
10/11/2023, 12:33 PMStylianos Gakis
10/11/2023, 12:34 PMmbonnin
10/11/2023, 12:38 PMbod
10/11/2023, 12:40 PMmbonnin
10/11/2023, 12:43 PMbod
10/11/2023, 12:44 PMStylianos Gakis
10/11/2023, 12:48 PMgives the 1st workflow as an example of what to doThe 1st one mentioned in that blogpost right? Regarding that Martin, you would still need to use that URL in your Retrofit(or whatever) instance. How different is that from initiating the call to the service you know it’s gonna go to instead?
mbonnin
10/11/2023, 12:49 PMStylianos Gakis
10/11/2023, 12:52 PMmbonnin
10/11/2023, 12:54 PMAnd in that scenario, how do we in the client get notified that the backend has now processed this? Do we need to poll through a GQL query perhaps?You don't know 🙈 . So either polling like you said or having another sync mutation that tells the server to process the resource
Stylianos Gakis
10/11/2023, 12:57 PMmbonnin
10/11/2023, 1:00 PMmutation { getUploadUrl { id url } }
2. Upload that using HTTP to some service
3. Once this is complete and succeeds, we note the uploadId
4. Take this ID and pass it in a mutation to our apollo-router backed backend service
5. Backend service uses that ID to find the resource
6. If it’s there, all is good and we get a success for the mutation
7. Life is goodStylianos Gakis
10/11/2023, 1:46 PM