 (defn merge-selection-sets
   [selections]
   (let [sets (reduce (fn [col selection]
-                       (println "merge-selection-sets: selection: " selection)
-                       (let [field (second (second selection))
-                             field-selection-set (:selection-set field)]
-                         (if field-selection-set
-                           (into col field-selection-set)
+                       (println (format "merge-selection-sets: col: %s, selection: %s." col selection))
+                       (let [field (:field (second selection))]
+                         (println "merge-selection-sets: field-selection-set: " field)
+                         (if field
+                           (into col field)
                            col)))
                      [] selections)]
     (println "merge-selection-sets: sets: " sets)

  [selection]
  {:post [(not (nil? %))]}
  (println "get-selection-object-name: " selection)
  (let [name (:name (second (second selection)))]
    (println "get-selection-object-name: name: " name)
    name))

(defn get-selection-name
  [selection]
  (println "get-selection-name: " selection)
  (let [name (:name (second (second selection)))]
    (println "get-selection-name: name: " name)
    name))

(defn get-selection-type [selection]
  (first (second selection)))

(defn collect-selection [col selection]
  (println "collect-selection: " selection)

        resolved-fields (get-field-entry object-type object fields)]
    resolved-fields))

(defn execute-fields
  [parent-type root-value fields]
  (println "*** execute-fields")
  (println "execute-fields: parent-type: " parent-type)
  (println "execute-fields: root-value: " root-value)
  (println "execute-fields: fields: " fields)
  (into {} (map (fn [field]
                  (let [response-key (get-selection-name field)
                        field-type (get-field-type-from-object-type parent-type field)
                        ;; resolved-object (resolve-field-on-object field-type root-value field)
                        field-entry (get-field-entry parent-type root-value field)]
                    field-entry))
                fields)))

(defn execute-query [query]
  (let [selection-set (:selection-set query)
        visitied-fragments nil
        object-type (get-type-meta :query)
        fields (collect-fields object-type selection-set visitied-fragments)]
    ;; (evaluate-selection-set object-type :root selection-set visitied-fragments)
    (execute-fields object-type :root fields)))

(defn execute-definition
  [definition]
  (println "*** execute-definition: " definition)
  (let [operation (:operation-definition definition)
        operation-type (:operation-type operation)]
    (case operation-type
      "query" (execute-query operation)
      (throw (ex-info (format "Unhandled operation root type: %s." operation-type))))))

(defn execute
  [document]
