【发布时间】:2019-02-09 14:49:43
【问题描述】:
我想使用 graphql 在服务器上触发 addLicenseCodeOneTimeUsage 操作。我不知道服务器会响应什么,我也不需要任何响应。如您所见,我在addLicenseCodeOneTimeUsage{} 中没有列出任何属性。
const client = new ApolloClient({
link: link,
cache: new InMemoryCache(),
});
yield client.mutate({
/* tslint:disable */
mutation: gql`
}
mutation licensemutation($distributor: String!, $licenceType: String!, $duration: String!, $userId: String!) {
addLicenseCodeOneTimeUsage(distributor: $distributor, licenseType: $licenseType, duration: $duration, userId: $userId) {
}
}
`,
/* tslint:enable */
variables: {
userId: username,
distributor: distributor,
licenseType: licenseType,
duration: duration,
},
});
- 到目前为止,我所写的内容是否合理,或者我对 graphql 的工作原理或应如何使用有明显的误解?
- 在 graphql 字符串中,我没有定义要接收什么信息。该语法是否有效,还是我需要明确声明我要忽略结果?
【问题讨论】:
标签: graphql apollo-client