babel-plugin-transform-bql

2.0.1 • Public • Published

babel-plugin-transform-bql

Transform the high level bicycle query language within template strings into the object spec expected by bicycle

Build Status Dependency Status NPM version

Installation

npm install babel-plugin-transform-bql --save

Example

const query = bql`
  user(id: ${myUserID}) {
    id,
    name
  }
  event(year: 2016, month: 3, day: 20) {
    title
  }
`;
 
console.log(query);

Compiles to:

const query = {
  ["user(id:" + JSON.stringify(myUserID) + ")"]: {
    id: true,
    name: true
  },
  "event(day:20,month:3,year:2016)": {
    title: true
  }
};
 
console.log(query);

License

MIT

Readme

Keywords

none

Package Sidebar

Install

npm i babel-plugin-transform-bql

Weekly Downloads

5

Version

2.0.1

License

MIT

Unpacked Size

25.6 kB

Total Files

8

Last publish

Collaborators

  • forbeslindesay