GraphQL error: Cannot query field 'authenticateUser' on type 'Mutation'


I am learning graphcool and setting up a facebook login with react native and apollo.
I have this query:

mutation AuthenticateUserMutation($facebookToken: String!) {
authenticateUser(facebookToken: $facebookToken) {


but I get this error on the callback:
GraphQL error: Cannot query field ‘authenticateUser’ on type ‘Mutation’. Did you mean ‘updateUser’ or
’createUser’? (line 2, column 3):
authenticateUser(facebookToken: $facebookToken) {

Any help on this? Thanks.


Your project does not contain this mutation. Did you add a respective resolver with that name?


Nilan, thanks for your reply.

I am very beginner with graphql, could you please explain me better what to do in my project? I tried to follow a tutorial on the website but it’s not for react-native and it is different. However I downloaded the facebook template from github. Thanks in advance.


In the Graphcool Framework, you need to deploy resolver functions to modify your schema. Did you add such a function in graphcool.yml?


I changed the hello function handlers from the template to this:

code: src/facebook/facebookAuthentication.ts
type: resolver
schema: src/facebookAuthentication.graphql


Did you deploy afterwards?


if you have any good tutorial to point me would be good. I understand I am too beginner for it :slight_smile:


Yes, I deployed and got the endpoints


Ok, I tried to deploy again and got another error:

Custom clusters (local/private):
local ▸ path must be a string or Buffer


The quickstart is a good option: :slight_smile:


Ok @nilan I followed your instructions read the quickstart guide. I am getting better :slight_smile:
So now I deployed correctly and then call the mutation, but I get this error that does not help at all:
From the logs:
{ "error": "Function returned invalid status code: 0. Raw body: empty.last" }

What I do, after installing and deploying the facebook template is :
this.props.authenticateUserMutation({variables: { facebookToken }}).then((r) => { console.log("RESPONSE FROM GRAPHQL: ", r); this.props.setToken(token.accessToken); })

It is hard to understand what I am doing wrong, I can see from the logs that the function gets the facebookId and the token, but I don’t understand where it is failing.
Do you have any suggestion? Thank you!