【发布时间】:2020-06-07 20:33:00
【问题描述】:
laugh =async()=> {
let mutation = gql`
mutation SignUp({$Email: String!
$Password: String!
}){
SignUp(data: {
Email: "tael32@gmil.com"
Password: "12345678"
}) {
User {
_id
Name
Rating
Photo
Badge
Email
}
Token
}}
`;
try {
let data = await client.mutate({mutation});
console.log('TCL: login -> data', data);
} catch (error) {
console.log('Majid', error);
}
}
当我调用这个函数时,它会在代码中产生错误,而它在帖子中正确运行
mutation {
SignUp(data: {
Email: "chetanvirani@gmail.com"
Password: "12345678"
Name: "Chetan"
}) {
User {
_id
Name
Rating
Photo
Password
Badge
Email
}
Token
}
}
这里是在邮递员中运行但不在代码中运行的代码,我不知道我的代码中的错误是什么
【问题讨论】:
标签: react-native graphql apollo-client