         root-type (get-operation-root-type operation state)
         fields (collect-fields root-type selection-set {} state)]
     (prn "execute-operation: root-type:" root-type)
+    (assert root-type "root-type is nil!")
     (if (seq (:errors validation-result))
       {:errors (:errors validation-result)}
       (case tag

      :list-type (:type field)
      (gerror/throw-error (format "Unhandled field type: %s (name = %s)." field field-name)))))

(defn- execute-field [parent-type parent-value fields field-type state]
  nil)

(defn- execute-fields
  "Implements the 'Executing selection sets' section of the spec for 'read' mode."
  [fields state parent-type parent-value]
  (reduce (fn execute-fields-field [result-map [response-key response-fields]]
            (prn "execute-fields-field:" response-key)
            (prn "parent-type:" parent-type)
            (let [parent-type-name (:name parent-type)
                  field-name (:name (first response-fields))
                  schema (:schema state)
                  field-type (get-field-type schema parent-type-name field-name)
                  response-value (execute-field parent-type parent-value fields field-type state)]
              (assoc result-map response-key response-value)))
          {}
          fields))


(defn- get-operation-root-type
  "Extracts the root type of the operation from the schema."
  [{:keys [tag] :as operation} {:keys [schema] :as state}]
  (prn "schema:" schema)
  (case tag
    :query-definition (get-in schema [:roots :query])
    :selection-set (get-in schema [:roots :query])
    :mutation (get-in schema [:roots :mutation])
    {:errors [{:message "Can only execute queries, mutations and subscriptions"}]}))

(defn- execute-operation
