如何解决在Appolo graphQl中的单个useeffect挂钩中使用多个查询
我必须在单个组件中使用多个突变,并使用1个usequery钩子; gql查询定义如下。
任何人都可以共享将所有这些突变整合到一个usemutation挂钩中的代码。
const Edit_Profile=gql`mutation{
changeName(
name: "navaneeth"
)
updateAvatar(
avatar_id: "11"
)
updateCity (
city:"bglr"
)
updateAbout (
about:"am lino"
)
}
解决方法
const Edit_Profile = gql`mutation EditProfile(
$name: String!
$avatar_id: String
$city: String
$about: String
) {
changeName(name: $name)
updateAvatar(avatar_id: $avatar_id)
updateCity(city: $city)
updateAbout(about: $about)
}`
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。