New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

scaffoldql

Package Overview
Dependencies
Maintainers
1
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

scaffoldql

A library that is used to generate object blueprints. Inspired by graphql

latest
Source
npmnpm
Version
0.1.1
Version published
Maintainers
1
Created
Source

npm version

ScaffoldQL

ScaffoldQL is a JavaScript library that is used to generate objects using scaffolds.

Inspired by GraphQL

Installation:

npm install --save scaffoldql

Usage:

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: ''
}
*/


Keywords

scaffold

FAQs

Package last updated on 04 Jun 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts