POC a GraphQL API using Lacinia. It follows the tutorial from the Lacinia Docs.
- Useful dependencies
- com.stuart/component: Manages dependencies and application state;
- com.mchange/c3p0: Manages connection pooling for JDBC;
- io.aviso/logging: Logging with correlated requests
- Example of application configuration with component;
- Example of an graphQL API with its schema defined in
edn
; - Example of database management with
jdbc
in clojure; - Utils for the
user
, the default namespace ofrepl
; - Logback configuration for tests executions;
- Useful examples of unit tests;
- Missing executable, all via
repl
.
You will need to execute some scripts to run your application properly. They are available in the bin
directory and help
you to create a database using Docker, define the tables required by the application and also add some data for testing purpose.
There are commands available to manage the API using REPL:
;; To start the API
(start)
;; To stop
(stop)
;; You can use this helper to execute queries or mutations
(q "{ game_by_id(id: \"1234\") { name designers { name games { name }}}}")
There are scripts in the directory .run
that allow you to run REPL and all the tests available. You just need to choose
one of them from the dropdown menu and press play 🛀🏽.
Copyright © 2022 Lucas dos Anjos Moraes
This program and the accompanying materials are made available under the terms of the Eclipse Public License 2.0 which is available at http://www.eclipse.org/legal/epl-2.0.
This Source Code may also be made available under the following Secondary Licenses when the conditions for such availability set forth in the Eclipse Public License, v. 2.0 are satisfied: GNU General Public License as published by the Free Software Foundation, either version 2 of the License, or (at your option) any later version, with the GNU Classpath Exception which is available at https://www.gnu.org/software/classpath/license.html.