I'm sorry @TheoMer, but I can't help any further without a reproduction. Could you please provide one with react-apollo-error-template?
@helfer You can find my fork of the error-template here
Yarn install away
Can confirm I also get this error.

This error is caused because apollo.mutate expects mutation to exist as a property of its first argument, rather than query.
I suggest adding a simple if to check if mutate has mutation defined and query has query defined, throw a clear error otherwise.
@greduan Thank you. But first allow me to, 'ahhhhhhhhh!!!'. Ok, I feel better now.
So. data.updatePosts. likes throws an Cannot read property 'likes' of undefined on handleSubmitSuccess. Any ideas?
mutation: gql`
mutation incrementPostLikes ($id: ID!, $count: Int) {
updatePosts (id: $id, likes: $count) {
id
likes
}
}
`,
variables: {
"id": idVal,
"count": incVal
},
// forceFetch: true,
})
.then(this.handleSubmitSuccess)
.catch(this.handleSubmitError);
},
handleSubmitError(err) {
console.error(err.message);
},
handleSubmitSuccess(data) {
console.log(data.updatePosts.likes);
}
Wouldn't it be res.data to access it or { data } as argument to handleSubmitSuccess?
So:
function handleSubmitSuccess({ data }) { data }
or
function handleSubmitSuccess(res) { res.data }
The auth.js code where the error hits
createUser = (authFields) => {
return new Promise( (resolve, reject) => {
Relay.Store.commitUpdate(
new CreateUser({
email: authFields.email,
idToken: authFields.idToken
}), {
onSuccess: (response) => {
this.signinUser(authFields)
resolve(response)
},
onFailure: (response) => {
console.log('CreateUser error', response)
response.getError().source
reject(response)
}
}
)
})
}
I am getting this error while creating user once it gets authenticated. I am using Auth0 to authenticate which works fine only when using relay and GraphQL API to insert/fetch the user details this error comes up as uncaught in promise. I did set the GraphQL endpoint for relay.
I am just getting started with these frameworks, please provide any pointers in direction to debug this.
Thanks!
Most helpful comment
@greduan Thank you. But first allow me to, 'ahhhhhhhhh!!!'. Ok, I feel better now.
So. data.updatePosts. likes throws an
Cannot read property 'likes' of undefinedon handleSubmitSuccess. Any ideas?