Skip to content

Commit

Permalink
Update site (#2)
Browse files Browse the repository at this point in the history
* Ignore :_siteCreateAt when verifying mutation

Fixes a broken test that is currently causing the CI build to fail.

FAIL in juxt.site.graphql-test/mutation-test (graphql_test.clj:280)
Expected:
  {:name "Malcolm Sparks", :juxt.site/type "Person", :xt/id "https://example.org/persons/mal"}
Actual:
  {:name "Malcolm Sparks",
   :juxt.site/type "Person",
   :xt/id "https://example.org/persons/mal",
   +:_siteCreatedAt "2022-05-26T13:28:50.568652Z"}

* upgrading Grab to latest (#76)

* Upgrade grab (#77)

* upgrading Grab to latest

* actually change the SHA

Co-authored-by: Malcolm Sparks <[email protected]>

* added enum case (#79)

* Update xtdb to 1.21

* Fix Indentation

Does clojure have a way to indent properly automatically....

* allow templating of subject username in q directive

* Improve resource importing/seeding

* Add cache control headers

* Use protected lookup

* Possibility to insert schema to validate data against as a site directive

* allow to mutate when there is no schema directive

* fix wrong validation schema

* negation logic in validation check, append test for mutation with schema

* append test with validation error

* Clean up unwanted changes from other branch

* make validation pass when no directive, align tests

* define `mutation-base` for more concise tests

* Extract selmer args to common function

* Fix indentation

Co-authored-by: Joe Littlejohn <[email protected]>
Co-authored-by: reborg <[email protected]>
Co-authored-by: Malcolm Sparks <[email protected]>
Co-authored-by: Jamie <[email protected]>
Co-authored-by: vollcheck <[email protected]>
  • Loading branch information
6 people authored Jul 5, 2022
1 parent 30ef0c1 commit 0101613
Show file tree
Hide file tree
Showing 8 changed files with 1,307 additions and 1,136 deletions.
7 changes: 6 additions & 1 deletion deps.edn
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,16 @@
com.xtdb/xtdb-http-server {:mvn/version "1.21.0"}
com.xtdb/xtdb-jdbc {:mvn/version "1.21.0"}
com.xtdb/xtdb-s3 {:mvn/version "1.21.0"}

mysql/mysql-connector-java {:mvn/version "8.0.29"}
diehard/diehard {:mvn/version "0.11.3"}

;; Jetty
ring/ring-jetty-adapter {:mvn/version "1.9.5"}

;; GraphQL schema validation
metosin/malli {:mvn/version "0.8.4"}

;; Logging
org.clojure/tools.logging {:mvn/version "1.2.4"}
org.slf4j/jcl-over-slf4j {:mvn/version "1.7.36"}
Expand All @@ -37,7 +41,7 @@

juxt/grab
{:git/url "https://github.com/juxt/grab.git"
:sha "50953efcb1cc1d104fa8f779795ae6e4944852c9"
:sha "62fc7f2869360d21a418eac9a01d999651a39c60"
;;:local/root "../grab"
}

Expand Down Expand Up @@ -89,6 +93,7 @@
{:extra-paths ["dev" "test"]
:extra-deps {;; Convenience libraries made available during development
org.clojure/test.check {:mvn/version "1.1.1"}
nrepl/nrepl {:mvn/version "0.9.0"}
org.clojure/alpha.spec {:git/url "https://github.com/clojure/spec-alpha2.git"
:sha "99456b1856a6fd934e2c30b17920bd790dd81775"}
org.eclipse.jetty/jetty-jmx {:mvn/version "9.4.44.v20210927"}}
Expand Down
7 changes: 2 additions & 5 deletions src/juxt/site/alpha/debug.clj
Original file line number Diff line number Diff line change
Expand Up @@ -20,16 +20,14 @@
{::http/content-type "application/json"
::http/etag "\"v1\""
::http/last-modified (:juxt.site.alpha/start-date request-to-show)
:ring.response/headers {"Cache-Control" "public, max-age=604800, immutable"}
::site/body-fn
(fn [req]
(-> (sorted-map)
(into request-to-show)
(json/write-value-as-string default-object-mapper)
(str "\r\n")
(.getBytes)))
;; TODO: use Cache-Control: immutable - see
;; https://www.keycdn.com/blog/cache-control-immutable and others
})
(.getBytes)))})

(defn html-representation-of-request [{::site/keys [db base-uri]} request-to-show]
(let [template (str base-uri "/_site/templates/debug-request.html")]
Expand All @@ -41,7 +39,6 @@
::site/type "TemplatedRepresentation"
::site/template template
::site/template-model request-to-show

#_#_::site/body-fn
(fn [req]
"<h1>Coming Soon...</h1>")
Expand Down
Loading

0 comments on commit 0101613

Please sign in to comment.