javascript - accounts-js GraphQL 客户端身份验证突变不起作用
问题描述
在 Apollo GraphQL 游乐场中,我有以下突变:
mutation {
authenticate(
serviceName: "password"
params: {
user: { email: "john.doe@john.com" }
password: "superSecurePassword"
}
) {
sessionId
tokens {
accessToken
refreshToken
}
user {
id
}
}
}
客户端我尝试以下操作:
export const LOGIN_USER = gql`
mutation Authenticate($email: String!, $password: String!) {
authenticate(email: $email, password: $password) {
id
token
}
}
`;
抛出异常:
46 | // Constructs an instance of ApolloError given a GraphQLError
47 | // or a network error. Note that one of these has to be a valid
48 | // value or the constructed error will be meaningless.
我哪里错了?
解决方案
尝试这个
导出 const LOGIN_USER = gql mutation Authenticate($email: String!, $password: String!) { authenticate(email: $email, password: $password) { sessionId tokens { accessToken refreshToken } user { id } } }
;
推荐阅读
- python - 基于另一个模型外键填充表单字段
- 姜戈 - scala - scala 从 REST 服务获取响应
- python - Selecting and using duplicate rows in a Pandas dataFrame
- mysql - 错误 1066 - 通过 mariaDb 中的 mysqldump 生成备份,重复视图的名称
- java - 代号 Web 服务向导缺少一个 web.xml
- jquery - Vue.JS 使用 props 将计算值从根组件传递到子组件
- java - 继续在我的 Spring Boot 应用程序上收到白标错误?
- mysql - 大型数据库表的设计技巧
- unity3d - 不知道在哪里统一等待
- r - 条件计数并将计数添加到列