Skip to content

Commit

Permalink
Upgrade all deps (#85)
Browse files Browse the repository at this point in the history
  • Loading branch information
oliyh authored Jan 28, 2022
1 parent abc0817 commit ab33cba
Show file tree
Hide file tree
Showing 6 changed files with 77 additions and 65 deletions.
4 changes: 2 additions & 2 deletions clj-http-gniazdo/project.clj
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
(defproject re-graph.clj-http-gniazdo "0.1.17-SNAPSHOT"
:dependencies [[clj-http "3.9.1"]
[stylefruits/gniazdo "1.1.3"]])
:dependencies [[clj-http "3.12.3"]
[stylefruits/gniazdo "1.2.0"]])
12 changes: 10 additions & 2 deletions clj-http-gniazdo/src/re_graph/interop.clj
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
(ns re-graph.interop
(:require [clj-http.client :as clj-http]
[re-frame.events]
[gniazdo.core :as gniazdo]))

(defn send-ws [instance payload]
Expand Down Expand Up @@ -28,5 +29,12 @@
:async? true
:throw-exceptions false
:throw-entire-message? true}))
on-success
on-error))
;; as of clj-http 3.10.0 the current thread bindings are restored on to the async callbacks
;; which makes re-frame think it's already handling an event, and rejecting any calls
;; to dispatch as a result, so we need to remove that binding explicitly before handling the callback
(fn [& args]
(binding [re-frame.events/*handling* nil]
(apply on-success args)))
(fn [& args]
(binding [re-frame.events/*handling* nil]
(apply on-error args)))))
10 changes: 5 additions & 5 deletions deps.edn
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{:deps {re-frame {:mvn/version "0.10.6"}
cljs-http {:mvn/version "0.1.45"}
cheshire {:mvn/version "5.8.1"}
re-graph.hato {:mvn/version "0.1.13-SNAPSHOT"}
org.clojure/tools.logging {:mvn/version "0.4.1"}}
{:deps {re-frame {:mvn/version "1.2.0"}
cljs-http {:mvn/version "0.1.46"}
cheshire {:mvn/version "5.10.2"}
re-graph.hato {:mvn/version "0.1.17-SNAPSHOT"}
org.clojure/tools.logging {:mvn/version "1.2.4"}}
:paths ["src"]}
2 changes: 1 addition & 1 deletion hato/project.clj
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
(defproject re-graph.hato "0.1.17-SNAPSHOT"
:dependencies [[hato "0.5.0"]])
:dependencies [[hato "0.8.2"]])
64 changes: 34 additions & 30 deletions project.clj
Original file line number Diff line number Diff line change
Expand Up @@ -15,53 +15,57 @@
["modules" "change" "version" "leiningen.release/bump-version"]
["vcs" "commit"]
["vcs" "push"]]
:dependencies [[re-frame "1.1.2"]
[cljs-http "0.1.45"]
[org.clojure/tools.logging "0.4.1"]
[cheshire "5.8.1"]
:dependencies [[re-frame "1.2.0"]
[cljs-http "0.1.46"]
[org.clojure/tools.logging "1.2.4"]
[cheshire "5.10.2"]
[re-graph.hato :version]]
:profiles {:provided {:dependencies [[org.clojure/clojure "1.10.3"]
[org.clojure/clojurescript "1.10.844"]]}
:dev {:source-paths ["dev" "hato/src"]
:resource-paths ["dev-resources"]
:dependencies [[org.clojure/tools.reader "1.3.4"]
[binaryage/devtools "0.9.10"]
[org.clojure/clojurescript "1.11.4"]]}
:dev {:source-paths ["dev"
"hato/src"
;;"clj-http-gniazdo/src"
]
:resource-paths ["dev-resources" "target"]
:clean-targets ^{:protect false} ["target"]
:dependencies [[org.clojure/tools.reader "1.3.6"]
[binaryage/devtools "1.0.4"]
[day8.re-frame/test "0.1.5"]
[com.bhauman/figwheel-main "0.2.13" :exclusions [org.eclipse.jetty.websocket/websocket-server
[com.bhauman/figwheel-main "0.2.15" :exclusions [org.eclipse.jetty.websocket/websocket-server
org.eclipse.jetty.websocket/websocket-servlet]]
[clj-http-fake "1.0.3"]

;; integration test
[org.eclipse.jetty.websocket/websocket-client "9.4.36.v20210114"]
[io.pedestal/pedestal.service "0.5.7"]
[org.eclipse.jetty/jetty-server "9.4.36.v20210114"]
[org.eclipse.jetty/jetty-servlet "9.4.36.v20210114"]
[org.eclipse.jetty/jetty-alpn-server "9.4.36.v20210114"]
[org.eclipse.jetty.http2/http2-server "9.4.36.v20210114"]
[org.eclipse.jetty.websocket/websocket-api "9.4.36.v20210114"]
[org.eclipse.jetty.websocket/websocket-servlet "9.4.36.v20210114"]
[org.eclipse.jetty.websocket/websocket-server "9.4.36.v20210114"]
[io.pedestal/pedestal.jetty "0.5.7"
[org.eclipse.jetty.websocket/websocket-client "9.4.44.v20210927"]
[io.pedestal/pedestal.service "0.5.10"]
[org.eclipse.jetty/jetty-server "9.4.44.v20210927"]
[org.eclipse.jetty/jetty-servlet "9.4.44.v20210927"]
[org.eclipse.jetty/jetty-alpn-server "9.4.44.v20210927"]
[org.eclipse.jetty.http2/http2-server "9.4.44.v20210927"]
[org.eclipse.jetty.websocket/websocket-api "9.4.44.v20210927"]
[org.eclipse.jetty.websocket/websocket-servlet "9.4.44.v20210927"]
[org.eclipse.jetty.websocket/websocket-server "9.4.44.v20210927"]
[io.pedestal/pedestal.jetty "0.5.10"
:exclusions [org.eclipse.jetty.http2/http2-server
org.eclipse.jetty.websocket/websocket-api
org.eclipse.jetty.websocket/websocket-server
org.eclipse.jetty.websocket/websocket-servlet
org.eclipse.jetty/jetty-alpn-server
org.eclipse.jetty/jetty-server
org.eclipse.jetty/jetty-servlet]]
[ch.qos.logback/logback-classic "1.2.3" :exclusions [org.slf4j/slf4j-api]]
[org.slf4j/jul-to-slf4j "1.7.26"]
[org.slf4j/jcl-over-slf4j "1.7.26"]
[org.slf4j/log4j-over-slf4j "1.7.26"]
[com.walmartlabs/lacinia-pedestal "0.13.0-alpha-1"]
[io.pedestal/pedestal.service-tools "0.5.7"]
[ch.qos.logback/logback-classic "1.2.10" :exclusions [org.slf4j/slf4j-api]]
[org.slf4j/jul-to-slf4j "1.7.35"]
[org.slf4j/jcl-over-slf4j "1.7.35"]
[org.slf4j/log4j-over-slf4j "1.7.35"]
[com.walmartlabs/lacinia-pedestal "1.1"]
[io.aviso/pretty "1.1.1"] ;; should be a transitive dependency from lacinia but for some reason doesn't work
[io.pedestal/pedestal.service-tools "0.5.10"]

;; hato
[hato "0.5.0"]
[hato "0.8.2"]

;; clj-http-gniazdo
[clj-http "3.9.1"]
[stylefruits/gniazdo "1.1.3"]]
[clj-http "3.12.3"]
[stylefruits/gniazdo "1.2.0"]]
:repl-options {:init-ns user}}
:clj-http-gniazdo {:source-paths ["clj-http-gniazdo/src"]}}
:aliases {"fig" ["trampoline" "run" "-m" "figwheel.main"]
Expand Down
50 changes: 25 additions & 25 deletions test/re_graph/integration_test.cljc
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
[re-graph.internals :as internals]
#?(:clj [clojure.test :refer [deftest testing is use-fixtures]]
:cljs [cljs.test :refer-macros [deftest testing is]])
[day8.re-frame.test :refer [run-test-async wait-for #?(:clj run-test-sync)]]
[day8.re-frame.test :refer [run-test-async wait-for #?(:clj with-temp-re-frame-state)]]
[re-frame.core :as re-frame]
[re-frame.db :as rfdb]
#?(:clj [re-graph.integration-server :refer [with-server]])))
Expand Down Expand Up @@ -59,30 +59,30 @@

#?(:clj
(deftest sync-http-test
(run-test-sync
(re-graph/init {:ws nil
:http {:url "http://localhost:8888/graphql"}})

(testing "sync query"
(is (= {:data
{:pets
[{:id "123", :name "Billy"}
{:id "234", :name "Bob"}
{:id "345", :name "Beatrice"}]}}
(re-graph/query-sync "{ pets { id name } }" {}))))

(testing "sync mutate"
(is (= {:data {:createPet {:id "999", :name "Zorro"}}}
(re-graph/mutate-sync "mutation { createPet(name: \"Zorro\") { id name } }" {}))))

(testing "error handling"
(is (= {:errors
[{:message "Cannot query field `malformed' on type `QueryRoot'.",
:locations [{:line 1, :column 9}],
:extensions {:type "QueryRoot"
:field "malformed"
:status 400}}]}
(re-graph/query-sync "{ malformed }" {})))))))
(with-temp-re-frame-state
(re-graph/init {:ws nil
:http {:url "http://localhost:8888/graphql"}})

(testing "sync query"
(is (= {:data
{:pets
[{:id "123", :name "Billy"}
{:id "234", :name "Bob"}
{:id "345", :name "Beatrice"}]}}
(re-graph/query-sync "{ pets { id name } }" {}))))

(testing "sync mutate"
(is (= {:data {:createPet {:id "999", :name "Zorro"}}}
(re-graph/mutate-sync "mutation { createPet(name: \"Zorro\") { id name } }" {}))))

(testing "error handling"
(is (= {:errors
[{:message "Cannot query field `malformed' on type `Query'.",
:locations [{:line 1, :column 9}],
:extensions {:type-name "Query"
:field-name "malformed"
:status 400}}]}
(re-graph/query-sync "{ malformed }" {})))))))

(deftest websocket-query-test
(run-test-async
Expand Down

0 comments on commit ab33cba

Please sign in to comment.