【发布时间】:2021-06-14 07:17:51
【问题描述】:
在 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.
我哪里错了?
【问题讨论】:
标签: javascript apollo-client apollo-server graphql-js