 
 (defn complete-value
   [field-type result sub-selection-set]
-  (println "complete-value: ")
+  (println "*** complete-value: ")
   (println "field-type: " field-type)
   (println "result: " result)
   (println "sub-selection-set: " sub-selection-set)

(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)
                           col)))
                     [] selections)]
    (println "merge-selection-sets: sets: " sets)

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

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

(defn get-selection-type [selection]
  (println "get-selection-type: selection: " selection)
  (let [opts (second selection)]
    (cond
      (:field opts) :field
      :default (throw (ex-info (format "Selection Type is not handled for selection: %s." selection) {:type (:field opts)
                                                                                             :opts opts})))))

(defn get-field-selection-set [selection]
  (println "*** get-field-selection-set: selection: " selection)
  (let [opts (second selection)
        selection-set (get-in opts [:field :selection-set])]
    (println "field: " opts)
    (println "get-field-selection-set: selection-set: " selection-set)
    selection-set))

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