All Projects → alumbra → Alumbra

alumbra / Alumbra

Licence: mit
Simple & Elegant GraphQL for Clojure!

Programming Languages

clojure
4091 projects

Labels

Projects that are alternatives of or similar to Alumbra

Practical Dapr
A full-stack .NET microservices build on Dapr and Tye
Stars: ✭ 140 (-6.67%)
Mutual labels:  graphql
Kraph
GraphQL request string builder written in Kotlin
Stars: ✭ 145 (-3.33%)
Mutual labels:  graphql
Codemirror Graphql
GraphQL mode and helpers for CodeMirror.
Stars: ✭ 147 (-2%)
Mutual labels:  graphql
Typescript Expo Apollo Boilerplate
Clean boilerplate for TypeScript + Expo (React Native) + React Apollo (GraphQL)
Stars: ✭ 144 (-4%)
Mutual labels:  graphql
Micro Graphql
GraphQL Microservice
Stars: ✭ 145 (-3.33%)
Mutual labels:  graphql
Reaction
Mailchimp Open Commerce is an API-first, headless commerce platform built using Node.js, React, GraphQL. Deployed via Docker and Kubernetes.
Stars: ✭ 11,588 (+7625.33%)
Mutual labels:  graphql
Absinthe relay
Absinthe support for the Relay framework
Stars: ✭ 143 (-4.67%)
Mutual labels:  graphql
Laravel Graphql
Facebook GraphQL for Laravel 5. It supports Relay, eloquent models, validation and GraphiQL.
Stars: ✭ 1,793 (+1095.33%)
Mutual labels:  graphql
Meteor Apollo Accounts
Meteor accounts in GraphQL
Stars: ✭ 145 (-3.33%)
Mutual labels:  graphql
Graphql Genie
Simply pass in your GraphQL type defintions and get a fully featured GraphQL API with referential integrity, inverse updates, subscriptions and role based access control that can be used client side or server side.
Stars: ✭ 147 (-2%)
Mutual labels:  graphql
Githunt Angular
An Apollo with Angular full-stack example app: vote for your favorite GitHub repos!
Stars: ✭ 144 (-4%)
Mutual labels:  graphql
Captain Fact Api
🔎 CaptainFact - API. The one that serves and process all the data for https://captainfact.io
Stars: ✭ 145 (-3.33%)
Mutual labels:  graphql
Apollo Server
🌍  Spec-compliant and production ready JavaScript GraphQL server that lets you develop in a schema-first way. Built for Express, Connect, Hapi, Koa, and more.
Stars: ✭ 12,145 (+7996.67%)
Mutual labels:  graphql
Gatsby Source Prismic Graphql
Gatsby source plugin for Prismic GraphQL
Stars: ✭ 144 (-4%)
Mutual labels:  graphql
Graphql Query Resolver
Minimize N+1 queries generated by GraphQL and ActiveRecord
Stars: ✭ 148 (-1.33%)
Mutual labels:  graphql
Amplify Photo Sharing Workshop
Building full-stack cloud apps with AWS Amplify and React
Stars: ✭ 143 (-4.67%)
Mutual labels:  graphql
Spree
Open Source headless multi-language/multi-currency/multi-store eCommerce platform
Stars: ✭ 11,571 (+7614%)
Mutual labels:  graphql
Core
The server component of API Platform: hypermedia and GraphQL APIs in minutes
Stars: ✭ 2,004 (+1236%)
Mutual labels:  graphql
Use Http
🐶 React hook for making isomorphic http requests
Stars: ✭ 2,066 (+1277.33%)
Mutual labels:  graphql
Forge
🏹 Free and open source developer tool.
Stars: ✭ 147 (-2%)
Mutual labels:  graphql

alumbra

Documentation

alumbra is a set of reusable GraphQL components for Clojure conforming to the data structures given in alumbra.spec. It also uses these components to provide an easy-to-use GraphQL infrastructure, allowing you to get started with minimal effort.

Build Status Clojars Project

Features

  • built upon claro resolvables, allowing you to leverage a powerful and customizable data access layer,
  • idiomatic Clojure value and name coercion (e.g., for record fields and enum values),
  • a fast parser and query validator,
  • compatible with GraphiQL,
  • and seamless integration with ring-compatible servers,

Quickstart

Note: You might want to familiarize yourself with claro's ideas and implementation since that's the source of a lot of alumbra's powers.

(require '[alumbra.core :as alumbra]
         '[claro.data :as data])

First, we declare our GraphQL schema and implement a Resolvable for each non-root type:

(def schema
  "type Person { name: String!, friends: [Person!]! }
   type QueryRoot { person(id: ID!): Person, me: Person! }
   schema { query: QueryRoot }")

(defrecord Person [id]
  data/Resolvable
  (resolve! [_ _]
    {:name    (str "Person #" id)
     :friends (map ->Person  (range (inc id) (+ id 3)))}))

Then we declare our QueryRoot and instantiate the handler:

(def QueryRoot
  {:person (map->Person {})
   :me     (map->Person {:id 0})})

(def app
  (alumbra/handler
    {:schema schema
     :query  QueryRoot}))

And this we pass to a Ring-compatible HTTP server of our choice:

(defonce my-graphql-server
  (aleph.http/start-server #'app {:port 3000}))

Check out our GraphQL endpoint!

$ curl -XPOST "http://0:3000" -H'Content-Type: application/json' -d'{
  "query": "{ me { name, friends { name } } }"
}'
{"data":{"me":{"name":"Person #0","friends":[{"name":"Person #1"},{"name":"Person #2"}]}}}

Documentation

  1. Component Overview

Contributing

Contributions are always welcome. Please take a look at the Contribution Guidelines for a quick overview of how your changes can best make it to master.

Note that issues for alumbra are tracked centrally within the alumbra issue tracker with single issues being mirrored to the respective repositories.

License

MIT License

Copyright (c) 2016-2017 Yannick Scherer

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].