  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  **/
 
-import FBSDKCoreKit
-import FBSDKShareKit
+import FacebookCore
+import FacebookShare
 
 struct Friend {
   let fbid: String

                                       cursor: String?,
                                       handler: @escaping EnumerationCallback) {
    var retrieved = 0
    var params = [ "fields": "id, name, first_name, last_name, picture" ]

    switch limit {
    case .none:

    }

    let path = type == .taggable ? "me/taggable_friends" : "me/friends"

    let request: GraphRequest =
        GraphRequest(graphPath: path, parameters: params,
                     accessToken: AccessToken.current, httpMethod: .GET,
                     apiVersion: .defaultVersion)
    request.start { (response, result) in
      switch result {
      case .success(let response):
        if let deserialised = response.dictionaryValue {
          if let data = deserialised["data"] as? [Any] {
            for serialised in data {
              guard
                let deserialised = serialised as? [String: Any],
                let friend = deserialiseFriend(deserialised)
              else {
                print("unable to deserialise friend \(serialised)")
                continue
              }

              handler(friend)
              retrieved += 1
            }
          }

          if let pagination = deserialised["paging"] as? [String:Any] {
            if let cursors = pagination["cursors"] as? [String:Any] {
              if let after = cursors["after"] as? String {
                switch limit {
                case .none:
                  self.enumerateFriends(type: type, limit: .none, cursor: after,
                                        handler: handler)
                  break
                case .count(let count):
                  self.enumerateFriends(type: type,
                                        limit: .count(count - retrieved),
                                        cursor: after, handler: handler)
                  break
                }
              }
            }
          }
        }
        break
      case .failed(let error):
        print("error executing GraphQL query: \(String(describing: error))")
        break
      }
    }
  }

