babel-plugin-transform-bql
v2.0.1
Published
Transform the high level bicycle query language within template strings into the object spec expected by bicycle
Downloads
6
Readme
babel-plugin-transform-bql
Transform the high level bicycle query language within template strings into the object spec expected by bicycle
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