@@ -362,7 +362,6 @@ export default class ElasticApiParser {
362362 case 'list' :
363363 return GraphQLJSON ;
364364 case 'enum' :
365- // $FlowFixMe
366365 if ( Array . isArray ( paramCfg . options ) ) {
367366 return this . getEnumType ( fieldName , paramCfg . options ) ;
368367 }
@@ -380,7 +379,7 @@ export default class ElasticApiParser {
380379 }
381380 }
382381
383- getEnumType ( fieldName : string , vals : string [ ] ) : GraphQLEnumType {
382+ getEnumType ( fieldName : string , vals : mixed [ ] ) : GraphQLEnumType {
384383 const key = fieldName ;
385384 const subKey = JSON . stringify ( vals ) ;
386385
@@ -393,9 +392,20 @@ export default class ElasticApiParser {
393392 ( result , val ) => {
394393 if ( val === '' ) {
395394 result . empty_string = { value : '' } ;
395+ } else if ( val === 'true' ) {
396+ result . true_string = { value : 'true' } ;
397+ } else if ( val === true ) {
398+ result . true_boolean = { value : true } ;
399+ } else if ( val === 'false' ) {
400+ result . false_string = { value : 'false' } ;
401+ } else if ( val === false ) {
402+ result . false_boolean = { value : false } ;
403+ } else if ( val === 'null' ) {
404+ result . null_string = { value : 'null' } ;
396405 } else if ( Number . isFinite ( val ) ) {
406+ // $FlowFixMe
397407 result [ `number_${ val } ` ] = { value : val } ;
398- } else {
408+ } else if ( typeof val === 'string' ) {
399409 result [ val ] = { value : val } ;
400410 }
401411 return result ;
0 commit comments