Reputation: 5174
I am getting the following error messages with the error code 400
, I have tried the same mutation query in GraphQL playground and it worked, but it won't work through nuxt.
$apollo.mutate({
mutation: gql`
mutation Session(
$accessToken: String!
$refreshToken: String!
$expiresIn: Int!
$scope: String!
) {
setSession(
accessToken: $accessToken
refreshToken: $refreshToken
expiresIn: $expiresIn
scope: $scope
) {
id
expiresIn
}
}
`,
variables() {
return {
accessToken: 'accessTkenTest',
refreshToken: 'refreshTkenTest',
expiresIn: 1000,
scope: 'connections email',
}
},
})
Upvotes: 0
Views: 591
Reputation: 84667
variables
should be an object, not a function:
variables: {
accessToken: 'accessTkenTest',
refreshToken: 'refreshTkenTest',
expiresIn: 1000,
scope: 'connections email',
},
Upvotes: 1