@@ -14,11 +14,11 @@ function checkHost(host): void {
1414
1515const schemaComposer = new SchemaComposer ( ) ;
1616
17- schemaComposer . Query . setField ( 'elastic60 ' , {
18- description : 'Elastic v6.0 ' ,
17+ schemaComposer . Query . setField ( 'elastic77 ' , {
18+ description : 'Elastic v7.7 ' ,
1919 type : schemaComposer . createObjectTC ( {
20- name : 'Elastic60 ' ,
21- fields : new ElasticApiParser ( { version : '6_0 ' , prefix : 'Elastic60 ' } ) . generateFieldMap ( ) ,
20+ name : 'Elastic77 ' ,
21+ fields : new ElasticApiParser ( { apiVersion : '7.7 ' , prefix : 'Elastic77 ' } ) . generateFieldMap ( ) ,
2222 } ) ,
2323 args : {
2424 host : {
@@ -31,42 +31,18 @@ schemaComposer.Query.setField('elastic60', {
3131 context . elasticClient = new elasticsearch . Client ( {
3232 // eslint-disable-line no-param-reassign
3333 host : args . host ,
34- apiVersion : '6.0 ' ,
34+ apiVersion : '7.7 ' ,
3535 requestTimeout : 5000 ,
3636 } ) ;
3737 return { } ;
3838 } ,
3939} ) ;
4040
41- schemaComposer . Query . setField ( 'elastic50 ' , {
42- description : 'Elastic v5.0 ' ,
41+ schemaComposer . Query . setField ( 'elastic68 ' , {
42+ description : 'Elastic v6.8 ' ,
4343 type : schemaComposer . createObjectTC ( {
44- name : 'Elastic50' ,
45- fields : new ElasticApiParser ( { version : '5_0' , prefix : 'Elastic50' } ) . generateFieldMap ( ) ,
46- } ) ,
47- args : {
48- host : {
49- type : 'String' ,
50- defaultValue : 'http://user:pass@example.com:9200' ,
51- } ,
52- } ,
53- resolve : ( src , args , context ) => {
54- checkHost ( args . host ) ;
55- context . elasticClient = new elasticsearch . Client ( {
56- // eslint-disable-line no-param-reassign
57- host : args . host ,
58- apiVersion : '5.0' ,
59- requestTimeout : 5000 ,
60- } ) ;
61- return { } ;
62- } ,
63- } ) ;
64-
65- schemaComposer . Query . setField ( 'elastic24' , {
66- description : 'Elastic v2.4' ,
67- type : schemaComposer . createObjectTC ( {
68- name : 'Elastic24' ,
69- fields : new ElasticApiParser ( { version : '2_4' , prefix : 'Elastic24' } ) . generateFieldMap ( ) ,
44+ name : 'Elastic60' ,
45+ fields : new ElasticApiParser ( { apiVersion : '6.8' , prefix : 'Elastic68' } ) . generateFieldMap ( ) ,
7046 } ) ,
7147 args : {
7248 host : {
@@ -79,18 +55,18 @@ schemaComposer.Query.setField('elastic24', {
7955 context . elasticClient = new elasticsearch . Client ( {
8056 // eslint-disable-line no-param-reassign
8157 host : args . host ,
82- apiVersion : '2.4 ' ,
58+ apiVersion : '6.8 ' ,
8359 requestTimeout : 5000 ,
8460 } ) ;
8561 return { } ;
8662 } ,
8763} ) ;
8864
89- schemaComposer . Query . setField ( 'elastic17 ' , {
90- description : 'Elastic v1.7 ' ,
65+ schemaComposer . Query . setField ( 'elastic56 ' , {
66+ description : 'Elastic v5.6 ' ,
9167 type : schemaComposer . createObjectTC ( {
92- name : 'Elastic17 ' ,
93- fields : new ElasticApiParser ( { version : '5_0 ' , prefix : 'Elastic17 ' } ) . generateFieldMap ( ) ,
68+ name : 'Elastic56 ' ,
69+ fields : new ElasticApiParser ( { apiVersion : '5.6 ' , prefix : 'Elastic56 ' } ) . generateFieldMap ( ) ,
9470 } ) ,
9571 args : {
9672 host : {
@@ -103,7 +79,7 @@ schemaComposer.Query.setField('elastic17', {
10379 context . elasticClient = new elasticsearch . Client ( {
10480 // eslint-disable-line no-param-reassign
10581 host : args . host ,
106- apiVersion : '1.7 ' ,
82+ apiVersion : '5.6 ' ,
10783 requestTimeout : 5000 ,
10884 } ) ;
10985 return { } ;
0 commit comments