Graphql CreateReadStream不是一个函数
嗨,我正在尝试使用GraphQL上传一个文件,我得到了以下错误Graphql CreateReadStream不是一个函数,graphql,apollo,strapi,Graphql,Apollo,Strapi,嗨,我正在尝试使用GraphQL上传一个文件,我得到了以下错误 Error: GraphQL error: createReadStream is not a function at new ApolloError (bundle.esm.js:63) at Object.next (bundle.esm.js:1004) at notifySubscription (Observable.js:135) at onNotify (Observable.js:17
Error: GraphQL error: createReadStream is not a function
at new ApolloError (bundle.esm.js:63)
at Object.next (bundle.esm.js:1004)
at notifySubscription (Observable.js:135)
at onNotify (Observable.js:179)
at SubscriptionObserver.next (Observable.js:235)
at bundle.esm.js:866
at Set.forEach (<anonymous>)
at Object.next (bundle.esm.js:866)
at notifySubscription (Observable.js:135)
at onNotify (Observable.js:179)
下面是我如何发布我的图片
client.mutate<UploadProfile, UploadProfileVariables>({
mutation: UploadProfileMutation,
variables: {
file: profileProperties.file,
},
context: {
headers: {
Authorization: `Bearer ${token}`,
},
},
})
client.mutate({
突变:上传突变,
变量:{
文件:profileProperties.file,
},
背景:{
标题:{
授权:`Bearer${token}`,
},
},
})
我不知道为什么它不起作用,我也没有在互联网上找到解决方案。请帮我解决它。我本来应该使用apollo upload客户端包中的createUploadLink而不是Httplink,但在使用GraphQL上载文档时,我也遇到了相同的错误。你能帮帮我吗?
client.mutate<UploadProfile, UploadProfileVariables>({
mutation: UploadProfileMutation,
variables: {
file: profileProperties.file,
},
context: {
headers: {
Authorization: `Bearer ${token}`,
},
},
})