canner
Version:
Build CMS in few lines of code for different data sources
36 lines (28 loc) • 567 B
Flow
// @flow
import type {Field, Types} from './types';
import NullField from './nullField';
export default class ScalarField implements Field {
type: Types;
schema: any;
key: string;
constructor({key, schema, type}: {key: string, schema: any, type: Types}) {
this.key = key;
this.schema = schema;
this.type = type;
}
getKey() {
return this.key;
}
getType() {
return this.type;
}
exists() {
return true;
}
getChild(fieldName: string) {
return new NullField({key: fieldName});
}
forEach() {
return;
}
}