0.1.1 • Published 6 years ago
scaffoldql v0.1.1
ScaffoldQL
ScaffoldQL is a JavaScript library that is used to generate objects using scaffolds.
Inspired by GraphQL
Installation:
npm install --save scaffoldqlUsage:
Simple Usage:
const { init } = require('scaffoldql')
const queryString = `
{
  parent {
    child {
      grandchild
    }
    anotherChild
  }
  anotherParent
}`
const store = init()
console.log(store.scaffold(queryString))
/*
{
  parent: {
    child: {
      grandchild: null
    },
    anotherChild: null
  },
  anotherParent: null
} 
 */With Types:
const { init } = require('scaffoldql')
const queryString = `
{
  name: String
  friends: Array
  sex: String
}
`
const store = init()
console.log(store.scaffold(queryString))
/*
{
  name: '',
  friends: [],
  sex: ''
}
*/By Defining Schemas
const { init } = require('scaffoldql')
const queryString = `
define Person {
  name: String
  friends: Array
  sex: String
}
`
const store = init()
store.registerSchema(queryString)
console.log(store.scaffoldSchema('Person'))
/*
{
  name: '',
  friends: [],
  sex: ''
}
*/0.1.1
6 years ago
0.0.3
6 years ago
0.1.0
6 years ago
0.0.2
6 years ago
0.0.1
7 years ago
0.0.1-webpack-bundle
7 years ago
0.0.1-webpack-dist
7 years ago
0.0.1-webpack-test
7 years ago
0.0.1-legacy
7 years ago
0.0.0-cleanup
7 years ago
0.0.0-setup
7 years ago