profusion / apollo-federation-file-upload

Add file upload support to Apollo Federated services.
32 stars 27 forks source link

using apollo federation file upload #35

Closed jaymarkjairi closed 3 years ago

jaymarkjairi commented 3 years ago

this is my code import { ApolloGateway, // RemoteGraphQLDataSource //replace by FileUploadDataSource from @profusion/apollo-federation-upload for file upload } from '@apollo/gateway' import FileUploadDataSource from '@profusion/apollo-federation-upload' const gateway = new ApolloGateway({ //RemoteGraphQLDataSource serviceList, //port:4010 buildService: ({ url }) => new FileUploadDataSource({ url, useChunkedTransfer: true }), useChunkedTransfer: true, })

this is the result in using it with the apollo gateway image

it shows this error BadRequestError: Missing multipart field ‘operations’.

but when directly uploading it to the subgraph this is the result image

either of the RemoteGraphQLDataSource and FileUploadDataSource has the same result, can you give me some advise in how I can fix this kind of issue? thank you

cabelitos commented 3 years ago

Not really sure what's happening, since I can't see the whole code. However I created a simple setup which works like a charm: https://codesandbox.io/s/silent-leftpad-0j63m?file=/index.js

Let me know if you still have problems. If you still have, please share a reproducible example.

jaymarkjairi commented 3 years ago

Thank you I can upload now I add uploads:false in apollo-sever-express but sometimes it give me errorr, I think that this is not cover by apollo federation file upload but can you help me where I can get help about this...

this is the error image

and I apply the same fix in Apollo server and gives me this error image

this is my code

image inside my server list image

and this is my code in apollo server express area

image

I think that I need to apply middle midleware in apollo server area, but when I use this line server.applyMiddleware() it will suggest me to use apollo server express image

image thank you so much for your'e help..