   [object-type selection-set visited-fragments]
   (reduce collect-selection [] selection-set))
 
+(comment ; Type kind
+  :SCALAR
+  :OBJECT
+  :INTERFACE
+  :UNION
+  :ENUM
+  :INPUT_OBJECT
+  :LIST
+  :NOT_NULL)
+
+(def type-map
+  {:UserType {:name "User"
+              :kind :OBJECT
+              :fields {:id {:type :GraphQLString}
+                       :name {:type :GraphQLString}}
+              :args {}
+              :resolve-fn (fn [object] {:id "test"})}})
+
+(def schema
+  {:query {:name "Query"
+           :kind :OBJECT
+           :fields {:user {:type :UserType}}
+           :args {:id :GraphQLString}}})
+
 (defn type-system-lookup
   [object-type object-name]
   (case object-type
     :root (case object-name
-            "user" {:type "user"
+            "user" {:name "User"
+                    :kind :OBJECT
+                    :fields {:id {:type :GraphQLString}
+                             :name {:type :GraphQLString}}
+                    :args {}
                     :resolve-fn (fn [object] {:id "test"})}
             (throw (ex-info (format "Unknown object name: %s." object-name) {})))
     (throw (ex-info (format "Unknown object type: %s." object-type) {}))))

    (resolve-fn object)))

(defn merge-selection-sets
  [fields]
  (reduce (fn [col field]
            (println "field: " field)
            (let [field-selection-set (:selection-set field)]
              (if field-selection-set
                (conj col field-selection-set))))
          [] fields))

(defn complete-value
  [field-type resolved-object sub-selection-set]
  (println "complete-value"))

(defn get-field-entry [object-type object fields]
  (let [first-field-selection (first fields)
        response-key (get-selection-name first-field-selection)
        field-type (get-field-type-from-object-type object-type first-field-selection)
        field-entry first-field-selection]
    (if (not (nil? field-type))
      (let [resolved-object (resolve-field-on-object object-type object field-entry)]
        (if (nil? resolved-object)

(defn get-selection-object-name
  [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)))
