INNER CODE UNIT · JavaScript
instanceRender
sheerun/graphqlviz · index.js:475
function instanceRender (schema, opts) {
if (_.isString(schema)) {
schema = JSON.parse(schema)
}
if (!_.isPlainObject(schema)) {
throw new Error('Must be plain object')
}
// find entry points
var rootPath = walkBFS.call(this, schema, (v, k, p) => {
if (k === '__schema') {
return p
}
})
if (!rootPath) {
throw new Error('Cannot find "__schema" object')