Contains a sample implementation of a GraphQL API and REST API powered by Clojure. The API allows to get sample data and demonstrates basic GraphQL functionality.
FYI
: this repository is fork of toyokumo/build-api-with-clojure. The foundamentals like the usage of some middlewares are explained on their tech blog.
Lacinia
: A GraphQL server library used to provide GraphQL API by Clojure.Ring
: A Clojure web applications library.Apollo
: A GraphQL server library used to provide GraphQL API by TypeScript.MySQL
: A relational database to store customer and related data.Prisma
: A Node.js ORM used to interact with the database in a more structured way.Sakila sample database
: A standard schema that can be used for examples in books, tutorials, articles, samples, and so forth, developed by Mike Hillyer, a former member of the MySQL AB documentation team. See also the document. All data depends on Sakila sample database.
You can use the following query to retrieve a paginated list of customers for example:
query Customers {
paginatedCustomers(offset: 0, limit: 10) {
totalCount
customers {
customer_id
store_id
first_name
last_name
email
address_id
active
}
}
}
This will return a paginated list of customers with a total count and basic customer details such as customer_id, first_name, and last_name.
For more detailed information such as the way of setting up or running query, please refer to the full document.
This project is licensed under the MIT License. See the LICENSE file for more details.