     Protocol.encode_list_of_terms(args)
   end
 
-  defp operation_and_maybe_refetch_schema(conn, op, args, opts) do
-    case C.operation(conn, op, args, opts) do
+  defp refetching_schema(conn, fun) do
+    case fun.() do
       {:error, :unknown_property_id} ->
         C.fetch_schema(conn)
-        C.operation(conn, op, args, opts)
+        fun.()
       o ->
         o
     end

            {:raw, command_class_name},
            {:raw, payload}]

    operation_and_maybe_refetch_schema(conn, :command, args, opts)
  end

  defp encode_query_with_type(:sql_query, query, opts) do

            {:raw, command_class_name},
            {:raw, payload}]

    refetching_schema conn, fn ->
      C.operation(conn, :command, args, opts)
    end
  end

  @doc """
