Skip to content

Instantly share code, notes, and snippets.

@officer-rosmarino
officer-rosmarino / discover-schema.js
Last active September 12, 2018 13:33
Loopback: Discover a schema in a db.
/*
* Discovers a table schema and outputs it into a file: run this script via:
* $ node discover-schema.js
*/
var path = require('path');
var fs = require('fs');
var app = require('loopback');
var output_directory = path.resolve(__dirname, '..', '..', 'common', 'models');
@JedWatson
JedWatson / notes.md
Last active February 20, 2020 13:01
Notes on how to create a new field type for Keystone

Creating new Field Types for KeystoneJS

We're currently working on making it easier to add new field types to KeystoneJS as plugins.

In the meantime, if you'd like to work on your own field type, hopefully this guide will point you in the right direction.

Keystone fields require the following:

  • a {fieldType}.js file in ./lib/fieldTypes that controls the field and encapsulates options support, underscore functions, validation and updating
  • the {fieldType}.js file needs to be included by ./lib/fieldTypes/index.js