public void GetCurrentUser(Action <User> callback)
 {
     APIGraphQL.Query(getCurrentUser, new { jwt = myToken }, response =>
     {
         print(response.Raw);
         callback(response.Get <User>("getCurrentUser"));
     });
 }
    public void Login(string username, string password, Action <string> callback)
    {
        APIGraphQL.Query(login, new { username = username, password = password }, response =>
        {
            var jwt = response.Get <string>("login");

            if (jwt != "Null")
            {
                myToken = jwt;

                PlayerPrefs.SetString("jwt", jwt);
                PlayerPrefs.Save();
            }

            callback(jwt);
        });
    }
 public void GetBase(string id, Action <Base> callback)
 {
     APIGraphQL.Query(getBase, new { id = id }, response => { print(response.Raw); callback(response.Get <Base>("getUserBase")); });
 }
 public void GetMyBase(Action <string> callback)
 {
     APIGraphQL.Query(getMyBase, new { jwt = myToken }, response => { callback(response.Get <string>("getBase")); });
 }
 public void GetApplicationName(Action <string> callback)
 {
     APIGraphQL.Query(getApplicationName, null, response => { callback(response.Get <string>("nameOfTheGame")); });
 }
 public void GetUser(string username, Action <User> callback)
 {
     APIGraphQL.Query(getUser, new { username = username }, response => { callback(response.Get <User>("getUser")); });
 }
 public void GetNearbyUsers(Action <List <User> > callback)
 {
     APIGraphQL.Query(getNearbyUsers, new { jwt = myToken }, response => { callback(response.Get <List <User> >("getNearbyPlayers")); });
 }
 public void AddCoins(int amount, Action <bool> callback)
 {
     APIGraphQL.Query(addCoins, new { jwt = myToken, amount = amount }, response => { callback(response.Get <bool>("addCoins")); });
 }
 public void UpdateBase(string baseData, Action <bool> callback)
 {
     APIGraphQL.Query(updateBase, new { jwt = myToken, data = baseData }, response => { callback(response.Get <bool>("updateBase")); });
 }