title: Facebook Graph API GET request - Should contain "fields" parameter (Swift, Facebook SDK v4.5.1)
body: <p>My iOS app uses Facebook's Graph API Request during sign up to get user information, which worked fine prior to upgrading to Facebook's newest SDK. After upgrading, I'm getting a runtime error stating: "FBSDKLog: starting with Graph API v2.4, GET requests for /me should contain an explicit "fields" parameter".</p>
  
  <p>Here is the code:</p>
  
  <pre><code>func requestFacebook() {
  
      let graphRequest : FBSDKGraphRequest = FBSDKGraphRequest(graphPath: "me", parameters: nil)
      graphRequest.startWithCompletionHandler({ (connection, result, error) -&gt; Void in
  
          if ((error) != nil)
          {
              // Process error
              println("Error: \(error)")
          }
          else if error == nil
          {
              let birthday : NSString = (result.valueForKey("birthday") as? NSString)!
  
              var currentDate = NSDate()
              var birthdayFormatter = NSDateFormatter()
              let userCalendar = NSCalendar.currentCalendar()
              birthdayFormatter.dateFormat = "MM/DD/YYYY"
              var birthdayNSDate = birthdayFormatter.dateFromString(birthday as String)
  
              var userAge = self.calculateAge(birthdayNSDate!)
  
              PFUser.currentUser()!["age"] = userAge
  
              var facebookID: NSString = (result.valueForKey("id") as? NSString)!
              var pictureURL = "https://graph.facebook.com/\(facebookID)/picture?type=large&amp;return_ssl_resources=1"
  
              var URLRequest = NSURL(string: pictureURL)
              var URLRequestNeeded = NSURLRequest(URL: URLRequest!)
  
              NSURLConnection.sendAsynchronousRequest(URLRequestNeeded, queue: NSOperationQueue.mainQueue(), completionHandler: {(response: NSURLResponse!,data: NSData!, error: NSError!) -&gt; Void in
                  if error == nil {
                      var picture = PFFile(data: data)
                      PFUser.currentUser()!["picture"] = picture
                      PFUser.currentUser()!.saveInBackgroundWithBlock({ (success, error) -&gt; Void in
                          if error == nil {
  
                              var userPicture:PFFile = PFUser.currentUser()!.valueForKey("picture") as! PFFile
                              userPicture.getDataInBackgroundWithBlock { (imageData, error) -&gt; Void in
                                  if error == nil {
  
                                      self.meProfileImageView.image = UIImage(data: imageData!)
                                      var userName:String = PFUser.currentUser()!.valueForKey("username") as! String
                                      var userAge:Int = PFUser.currentUser()!.valueForKey("age") as! Int
                                      self.meLabel.text = "\(userName), \(userAge)"
  
                                      self.findFriends()
  
                                  }
                              }
  
                          } else {
                              println(error)
                          }
                      })
                  }
                  else {
                      println("Error: \(error.localizedDescription)")
                  }
              })
          }
      })
  }
  </code></pre>
  
  <p>The error message is at the line:</p>
  
  <pre><code>let birthday : NSString = (result.valueForKey("birthday") as? NSString)!
  </code></pre>
  
  <p>This code ran perfectly fine before upgrading to Facebook's SDK v4.5.1, but I don't know what to change to make this work now. Huge thanks to anyone that can help me!</p>