Skip to content
Microservice query language
Clojure
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
node fix(node): change module directory Jul 8, 2019
src fix(query): allow brackets only on parameter name (#108) Jan 8, 2020
test
.editorconfig chore(editor): add editorconfig Nov 13, 2018
.gitignore chore(npm): create npm package (#79) Jun 19, 2019
.npmignore bump npm to 0.1.5 Jul 11, 2019
.travis.yml chore(deploy): add clojars deploy on travis Dec 6, 2018
LICENSE releasing first version Dec 21, 2016
README.md Update README.md (#97) Oct 17, 2019
package.json bump npm to 0.1.5 Jul 11, 2019
project.clj bump version to 3.5.7 Jan 8, 2020

README.md

restQL-clojure allows to run restQL queries, making easy to fetch information from multiple services in the most efficient manner

restQL on travis-ci

Getting Started

Installation

Add restQL dependency to your project

Lein

[b2wdigital/restql-core "3.4.1"]

NPM

npm i @b2wdigital/restql

First query

Clojure

(require '[restql.core.api.restql :as restql])
(restql/execute-query :mappings { :user "http://your.api.url/users/:name" } :query "from user with name = $name" :params { :name "Duke Nukem" } )

Node

var restql = require('@b2wdigital/restql')

// executeQuery(mappings, query, params, options) => <Promise>
restql
  .executeQuery(
    {user: "http://your.api.url/users/:name"},
    "from user with name = $name",
    { name: "Duke Nukem" })
  .then(response => console.log(response))
  .catch(error => console.log(error))

In the example above restQL will call user API passing "Duke Nukem" in the name param.

Our query language

The clause order matters when making restQL queries. The following is a full reference to the query syntax, available clauses and order.

[ [ use modifier = value ] ]

METHOD resource-name [as some-alias] [in some-resource]
  [ headers HEADERS ]
  [ timeout INTEGER_VALUE ]
  [ with WITH_CLAUSES ]
  [ [only FILTERS] OR [hidden] ]
  [ [ignore-errors] ]

e.g:

from search
    with
        role = "hero"

from hero as heroList
    with
        name = search.results.name

Learn more about restQL query language

Links

Reach the community

Who's talking about restQL

License

Copyright © 2016-2019 B2W Digital

Distributed under the MIT License.

You can’t perform that action at this time.