 (def munge-fn-hook identity)
 
 (defn- deprecated-produce-streaming-body
-  [version query-map options]
+  [version query-map context]
   (let [{:keys [scf-read-db url-prefix warn-experimental pretty-print log-queries]
          :or {warn-experimental true
               pretty-print false
-              log-queries false}} options
+              log-queries false}} context
         log-id (when log-queries (str (java.util.UUID/randomUUID)))
-        query-config (select-keys options [:node-purge-ttl :add-agent-report-filter])
+        query-config (select-keys context [:node-purge-ttl :add-agent-report-filter])
         {:keys [query remaining-query entity query-options]}
         (user-query->engine-query version query-map query-config warn-experimental)]
 

  (->> (or (System/getenv "PDB_USE_DEPRECATED_QUERY_STREAMING_METHOD") "yes")
       (re-matches #"yes|true|1") seq not))

(def query-options-schema
  {:scf-read-db s/Any
   :url-prefix String
   :node-purge-ttl Period

     :stream stream}))

(defn preferred-produce-streaming-body
  [version query-map context]
  (let [{:keys [scf-read-db url-prefix warn-experimental pretty-print log-queries]
         :or {warn-experimental true
              pretty-print false
              log-queries false}} context
        log-id (when log-queries (str (java.util.UUID/randomUUID)))
        query-config (select-keys context [:node-purge-ttl :add-agent-report-filter])
        {:keys [query remaining-query entity query-options]}
        (user-query->engine-query version query-map query-config warn-experimental)]

