'Graphql upload file shows as empty object
when I'm trying to upload file via Graphql mutation (apollo-angular
) with parameter $file: Upload!
, the variable value is shown as an empty object
in developer tools:
But I'm checking the value of the variable right before the request and the value is correct, it is in fact a File, not an empty object.
import gql from 'graphql-tag';
import { Apollo } from 'apollo-angular';
this.apollo.mutate(
{
mutation: gql`
${uploadMutation}
`,
variables: {
companyId,
file <-- Here the value is correct, it is a File
},
context: {
hasUpload: true,
useMultipart: true
}
},
'upload'
);
Code is simplified for the sake of this example.
Is it just developer tools issue, am I doing something wrong or what is the problem please?
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|