From a6215b9e4eda573dd9ffb3d845b486641d695db6 Mon Sep 17 00:00:00 2001 From: "Howard M. Lewis Ship" Date: Fri, 23 Jun 2023 12:33:06 -0700 Subject: [PATCH] Prep for 1.2 release --- CHANGELOG.md | 4 +++- README.md | 32 +++++++++++++++----------------- build.clj | 3 ++- 3 files changed, 20 insertions(+), 19 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6db208b..fed3ed7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,8 +1,10 @@ -## 1.2 -- UNRELEASED +## 1.2 -- 23 Jun 2023 Logging from the `com.walmartlabs.lacinia.pedestal.subscriptions` namespace now is at level TRACE, not DEBUG. +Dependency on Pedestal updated to 0.6.0. + [Closed Issues](https://github.com/walmartlabs/lacinia-pedestal/issues?q=is%3Aclosed+milestone%3A1.2) ## 1.1 -- 14 Jan 2020 diff --git a/README.md b/README.md index 5dcdeda..0d50bc0 100644 --- a/README.md +++ b/README.md @@ -2,6 +2,7 @@ [![Clojars Project](https://img.shields.io/clojars/v/com.walmartlabs/lacinia-pedestal.svg)](https://clojars.org/com.walmartlabs/lacinia-pedestal) [![CI](https://github.com/walmartlabs/lacinia-pedestal/actions/workflows/config.yml/badge.svg)](https://github.com/walmartlabs/lacinia-pedestal/actions/workflows/config.yml) +[![API DOCS](https://cljdoc.org/badge/com.walmartlabs/lacinia-pedestal)](https://cljdoc.org/d/com.walmartlabs/lacinia-pedestal) A library that adds the [Pedestal](https://github.com/pedestal/pedestal) underpinnings needed when exposing @@ -20,22 +21,20 @@ the `com.walmartlabs.lacinia.pedestal2/default-service` function to generate a service, then invoke `io.pedestal.http/create-server` and `/start`. ```clojure -;; This example is based off of the code generated from the template -;; `lein new pedestal-service graphql-demo` - (ns graphql-demo.server (:require [io.pedestal.http :as http] [com.walmartlabs.lacinia.pedestal2 :as lp] - [com.walmartlabs.lacinia.schema :as schema])) + [com.walmartlabs.lacinia.schema :as schema] + [com.walmartlabs.lacinia.util :as util])) (def hello-schema - (schema/compile - {:queries - {:hello - ;; String is quoted here; in EDN the quotation is not required - ;; You could also use :String - {:type 'String - :resolve (constantly "world")}}})) + (-> {:objects + {:Query + {:fields + ;; String is quoted here; in EDN the quotation is not required + ;; You could also use :String + {:hello {:type 'String}}}}} + (util/inject-resolvers {:Query/hello (constantly "hello")}))) ;; Use default options: (def service (lp/default-service hello-schema nil)) @@ -45,7 +44,6 @@ generate a service, then invoke `io.pedestal.http/create-server` and `/start`. (defonce runnable-service (http/create-server service)) (defn -main - "The entry-point for 'lein run'" [& args] (println "\nCreating your server...") (http/start runnable-service)) @@ -53,7 +51,7 @@ generate a service, then invoke `io.pedestal.http/create-server` and `/start`. Lacinia will handle POST requests at the `/api` endpoint: -``` +```bash $ curl localhost:8888/api -X POST -H "content-type: application/json" -d '{"query": "{ hello }"}' {"data":{"hello":"world"}} ``` @@ -73,16 +71,16 @@ the compiled schema based on the latest code you've loaded into the REPL. ## Beyond default-server -`default-server` is intentionally limited, and exists only to help you get started. +`default-service` is intentionally limited, and exists only to help you get started. Once you start adding anything more complicated, such as authentication, or supporting multiple schemas (or schema versions) at different paths, -you will want to simply create your routes and servers in your own code, +you will want to simply create your routes and server in your own code, using the building-blocks provided by `com.walmartlabs.lacinia.pedestal2`. ### GraphiQL The GraphiQL packaged inside the library is built using `npm`, from -version `1.4.7`. +version `1.7.1`. If you are including lacinia-pedestal via Git coordinate (rather than a published version of the library by using a :mvn/version coordinate), then the library will need to be prepped for use @@ -94,7 +92,7 @@ to execute GraphiQL. ## License -Copyright © 2017-2022 Walmart +Copyright © 2017-2024 Walmart Distributed under the Apache Software License 2.0. diff --git a/build.clj b/build.clj index 96fd238..b948db5 100644 --- a/build.clj +++ b/build.clj @@ -19,7 +19,7 @@ [net.lewisship.build :as b])) (def lib 'com.walmartlabs/lacinia-pedestal) -(def version "1.2-beta-1") +(def version "1.2") (def project-opts {:project-name lib @@ -55,6 +55,7 @@ (defn jar [_params] + (clean nil) (prep nil) (b/create-jar project-opts))