diff --git a/package.json b/package.json index 60709b2..1f0a8ac 100644 --- a/package.json +++ b/package.json @@ -52,9 +52,9 @@ "eslint-plugin-prettier": "3.1.2", "express": "^4.17.1", "express-graphql": "^0.9.0", - "flow-bin": "0.110.0", + "flow-bin": "0.118.0", "graphql": "14.6.0", - "graphql-compose": "7.11.0", + "graphql-compose": "7.12.0", "jest": "25.1.0", "nodemon": "2.0.2", "npm-run-all": "^4.1.5", diff --git a/src/elasticDSL/Query/Geo/GeoDistance.js b/src/elasticDSL/Query/Geo/GeoDistance.js index e2d40f1..2e35144 100644 --- a/src/elasticDSL/Query/Geo/GeoDistance.js +++ b/src/elasticDSL/Query/Geo/GeoDistance.js @@ -43,7 +43,7 @@ export function getGeoDistanceITC( description: 'Eg. 12km', }, distance_type: getDistanceCalculationModeFC(opts), - ...fields, + ...(fields: any), validation_method: 'String', }, })); diff --git a/src/elasticDSL/Query/Query.js b/src/elasticDSL/Query/Query.js index 75de430..5f2ee41 100644 --- a/src/elasticDSL/Query/Query.js +++ b/src/elasticDSL/Query/Query.js @@ -56,54 +56,53 @@ export function getQueryITC(opts: CommonOpts): InputTypeComp return opts.getOrCreateITC(name, () => ({ name, description, - // $FlowFixMe fields: { - match_all: () => getMatchAllITC(opts), + match_all: getMatchAllITC(opts), // Compound quries - bool: () => getBoolITC(opts), - constant_score: () => getConstantScoreITC(opts), - dis_max: () => getDisMaxITC(opts), - boosting: () => getBoostingITC(opts), - function_score: () => getFunctionScoreITC(opts), + bool: getBoolITC(opts), + constant_score: getConstantScoreITC(opts), + dis_max: getDisMaxITC(opts), + boosting: getBoostingITC(opts), + function_score: getFunctionScoreITC(opts), // FullText queries - match: () => getMatchITC(opts), - match_phrase: () => getMatchPhraseITC(opts), - match_phrase_prefix: () => getMatchPhrasePrefixITC(opts), - multi_match: () => getMultiMatchITC(opts), - common: () => getCommonITC(opts), - query_string: () => getQueryStringITC(opts), - simple_query_string: () => getSimpleQueryStringITC(opts), + match: getMatchITC(opts), + match_phrase: getMatchPhraseITC(opts), + match_phrase_prefix: getMatchPhrasePrefixITC(opts), + multi_match: getMultiMatchITC(opts), + common: getCommonITC(opts), + query_string: getQueryStringITC(opts), + simple_query_string: getSimpleQueryStringITC(opts), // Term queries - exists: () => getExistsITC(opts), - fuzzy: () => getFuzzyITC(opts), - ids: () => getIdsITC(opts), - prefix: () => getPrefixITC(opts), - range: () => getRangeITC(opts), - regexp: () => getRegexpITC(opts), - type: () => getTypeITC(opts), - term: () => getTermITC(opts), - terms: () => getTermsITC(opts), - wildcard: () => getWildcardITC(opts), + exists: getExistsITC(opts), + fuzzy: getFuzzyITC(opts), + ids: getIdsITC(opts), + prefix: getPrefixITC(opts), + range: getRangeITC(opts), + regexp: getRegexpITC(opts), + type: getTypeITC(opts), + term: getTermITC(opts), + terms: getTermsITC(opts), + wildcard: getWildcardITC(opts), // Geo queries - geo_bounding_box: () => getGeoBoundingBoxITC(opts), - geo_distance: () => getGeoDistanceITC(opts), - geo_polygon: () => getGeoPolygonITC(opts), - geo_shape: () => getGeoShapeITC(opts), + geo_bounding_box: getGeoBoundingBoxITC(opts), + geo_distance: getGeoDistanceITC(opts), + geo_polygon: getGeoPolygonITC(opts), + geo_shape: getGeoShapeITC(opts), // Specialized queries - more_like_this: () => getMoreLikeThisITC(opts), - percolate: () => getPercolateITC(opts), - script: () => getScriptITC(opts), + more_like_this: getMoreLikeThisITC(opts), + percolate: getPercolateITC(opts), + script: getScriptITC(opts), // Joining queries - has_child: () => getHasChildITC(opts), - has_parent: () => getHasParentITC(opts), - nested: () => getNestedITC(opts), - parent_id: () => getParentIdITC(opts), + has_child: getHasChildITC(opts), + has_parent: getHasParentITC(opts), + nested: getNestedITC(opts), + parent_id: getParentIdITC(opts), }, })); } diff --git a/src/resolvers/search.js b/src/resolvers/search.js index a6d9577..7247a94 100644 --- a/src/resolvers/search.js +++ b/src/resolvers/search.js @@ -78,6 +78,7 @@ export default function createSearchResolver( .removeField(topLevelArgs); Object.keys(argsConfigMap).forEach(argKey => { if (topLevelArgs.indexOf(argKey) === -1) { + // $FlowFixMe delete argsConfigMap[argKey]; } }); diff --git a/src/types/FindByIdOutput.js b/src/types/FindByIdOutput.js index 267ff2c..3b1aa8a 100644 --- a/src/types/FindByIdOutput.js +++ b/src/types/FindByIdOutput.js @@ -15,7 +15,7 @@ export function getFindByIdOutputTC( _index: 'String', _type: 'String', _version: 'Int', - ...sourceTC.getFields(), + ...(sourceTC.getFields(): any), }, })); } diff --git a/src/types/UpdateByIdOutput.js b/src/types/UpdateByIdOutput.js index 1a42619..3fedd5d 100644 --- a/src/types/UpdateByIdOutput.js +++ b/src/types/UpdateByIdOutput.js @@ -16,7 +16,7 @@ export function getUpdateByIdOutputTC( _type: 'String', _version: 'Int', result: 'String', - ...sourceTC.getFields(), + ...(sourceTC.getFields(): any), }, })); } diff --git a/src/utils.js b/src/utils.js index 580bff8..2651e45 100644 --- a/src/utils.js +++ b/src/utils.js @@ -38,7 +38,7 @@ export type CommonOpts = { export function prepareCommonOpts( schemaComposer: SchemaComposer, - opts: mixed = {} + opts: any = {} ): CommonOpts { return { schemaComposer, diff --git a/yarn.lock b/yarn.lock index b745acf..8586a01 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3453,10 +3453,10 @@ flatted@^2.0.0: resolved "https://registry.yarnpkg.com/flatted/-/flatted-2.0.1.tgz#69e57caa8f0eacbc281d2e2cb458d46fdb449e08" integrity sha512-a1hQMktqW9Nmqr5aktAux3JMNqaucxGcjtjWnZLHX7yyPCmlSV3M54nGYbqT8K+0GhF3NBgmJCc3ma+WOgX8Jg== -flow-bin@0.110.0: - version "0.110.0" - resolved "https://registry.yarnpkg.com/flow-bin/-/flow-bin-0.110.0.tgz#c6c140e239f662839d8f61b64b7b911f12d3306c" - integrity sha512-mmdEPEMoTuX+mguy/tjRlOlCtPfVdXZQeMgCAsEDVDgWMA5vwWhM2y653OcJiKX38t4gtZ2e/MNVo0qzyYeZDQ== +flow-bin@0.118.0: + version "0.118.0" + resolved "https://registry.yarnpkg.com/flow-bin/-/flow-bin-0.118.0.tgz#fb706364a58c682d67a2ca7df39396467dc397d1" + integrity sha512-jlbUu0XkbpXeXhan5xyTqVK1jmEKNxE8hpzznI3TThHTr76GiFwK0iRzhDo4KNy+S9h/KxHaqVhTP86vA6wHCg== flush-write-stream@^1.0.0: version "1.1.1" @@ -3772,10 +3772,10 @@ graceful-fs@^4.1.11, graceful-fs@^4.1.15, graceful-fs@^4.1.2, graceful-fs@^4.1.6 resolved "https://registry.yarnpkg.com/graceful-readlink/-/graceful-readlink-1.0.1.tgz#4cafad76bc62f02fa039b2f94e9a3dd3a391a725" integrity sha1-TK+tdrxi8C+gObL5Tpo906ORpyU= -graphql-compose@7.11.0: - version "7.11.0" - resolved "https://registry.yarnpkg.com/graphql-compose/-/graphql-compose-7.11.0.tgz#77e7435918f7f9a186ae9e939fa2c92c3bb85cdd" - integrity sha512-vmAaNA4BUM7PBe1PpujLRIsAlx1qjaoAsol1IvGQKBIi8TwdrLnFZEza0O7+AalqbmcP2eqZ5On/pALP/88ZiA== +graphql-compose@7.12.0: + version "7.12.0" + resolved "https://registry.yarnpkg.com/graphql-compose/-/graphql-compose-7.12.0.tgz#223e3c811c18e18e153be2c77c632afa3015477a" + integrity sha512-AbuQl2LfHYWtgVNJd8De2m8+KtJnkIXII8QkuSt2NMsniFc7DUuIp3MBaNPS9pRCA6l1OTGk2labuWRSyXZVlw== dependencies: graphql-type-json "^0.3.1" object-path "^0.11.4"