Hi, I am trying to send a filled form with a file included. I have tried to send only the file and everything works fine but when I attempt to add more values in addition to the file I get an error.
I have the following code in the client:
const client = new ApolloClient({
link: createUploadLink({
uri: 'http://localhost:4000/graphql',
}), ....
const values = Array.from(documents);
const data = new FormData();
for (let i = 0; i < values.length; i++) {
data.append("documents", documents[i]);
}
data.set("didOrder", did);
data.set("idOrder", idOrder);
data.set("stepName", stepName);
data.set("incidences", incidences);
data.set("shippingPrice", shippingPrice);
DeliverStep({ variables: { order: data } });
Where documents are my files
En el lado del servidor tengo definido mi scalar Upload en el schema y en el resolver Upload: GraphQLUpload . Además como uso Express he definido app.use(graphqlUploadExpress());
Can someone help me?