import { xLuceneFieldType , ESTypeMapping , xLuceneTypeConfig } from '@terascope/types' ; import BaseType from '../base-type' ; import { GraphQLType , TypeESMapping } from '../../interfaces' ; export default class ObjectType extends BaseType { toESMapping ( _version ? ) { const type = this . config . array ? 'nested' : 'object' ; const typeConfig = { type } ; if ( this . config . indexed === false ) { typeConfig . enabled = false ; } return { mapping : { [ this . field ] : typeConfig } } ; } toGraphQL ( ) { return this . _formatGql ( 'JSONObject' , 'scalar JSONObject' ) ; } toXlucene ( ) { return { [ this . field ] : xLuceneFieldType . Object } ; } }