Skip to content

Commit

Permalink
Prep for 1.2 release
Browse files Browse the repository at this point in the history
  • Loading branch information
hlship committed Jun 23, 2023
1 parent 99d1824 commit a6215b9
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 19 deletions.
4 changes: 3 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
32 changes: 15 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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))
Expand All @@ -45,15 +44,14 @@ 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))
```

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"}}
```
Expand All @@ -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
Expand All @@ -94,7 +92,7 @@ to execute GraphiQL.

## License

Copyright © 2017-2022 Walmart
Copyright © 2017-2024 Walmart

Distributed under the Apache Software License 2.0.

Expand Down
3 changes: 2 additions & 1 deletion build.clj
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -55,6 +55,7 @@

(defn jar
[_params]
(clean nil)
(prep nil)
(b/create-jar project-opts))

Expand Down

0 comments on commit a6215b9

Please sign in to comment.