【发布时间】:2018-11-26 02:58:23
【问题描述】:
我有一个突变:
const createSomethingMutation = gql`
mutation($data: SomethingCreateInput!) {
createSomething(data: $data) {
something {
id
name
}
}
}
`;
如何在一个请求中创建多个Somethings?我是否需要像这样在我的 GraphQL 服务器上创建一个新的 Mutation:
mutation {
addManySomethings(data: [SomethingCreateInput]): [Something]
}
或者有没有一种方法可以在一个请求中多次使用来自 Apollo 客户端的现有 createSomethingMutation 和不同的参数?
【问题讨论】:
标签: graphql apollo graphql-js react-apollo apollo-client