小编Arc*_*chy的帖子

如何使用 axios 将文件上传到使用 graphql-upload 实现的 graphql 后端?

我有一个使用expressexpress-graphqlgraphqlgraphql-upload实现的 GraphQL 后端。我的 GraphQL 架构声明如下:

type OProject {
    _id: ID!
    title: String!
    theme: String!
    budget: Float!
    documentation: String!
    date: Date
}

input IProject {
    title: String!
    theme: String!
    budget: Float!
    file: Upload!
}

type Mutations {
    create(data: IProject): OProject
}

type Mutation {
    Project: Mutations
}
Run Code Online (Sandbox Code Playgroud)

我想使用axioscreate/graphql 上向我的 GraphQL API 发出请求。我该怎么办?

express graphql axios

3
推荐指数
1
解决办法
1404
查看次数

标签 统计

axios ×1

express ×1

graphql ×1