diff --git a/.flowconfig b/.flowconfig index f9c05b6bff..3a7560f6ca 100644 --- a/.flowconfig +++ b/.flowconfig @@ -10,3 +10,6 @@ [options] experimental.const_params=true + +[version] +^0.54.0 diff --git a/package.json b/package.json index 08aa05163f..2d0ac08b79 100644 --- a/package.json +++ b/package.json @@ -56,7 +56,7 @@ "eslint": "4.4.1", "eslint-plugin-babel": "4.1.2", "eslint-plugin-flowtype": "2.35.0", - "flow-bin": "0.52.0", + "flow-bin": "^0.54.0", "isparta": "4.0.0", "mocha": "3.5.0", "sane": "2.0.0" diff --git a/src/subscription/__tests__/eventEmitterAsyncIterator.js b/src/subscription/__tests__/eventEmitterAsyncIterator.js index 8fe45a4ec3..0f6fb95ec1 100644 --- a/src/subscription/__tests__/eventEmitterAsyncIterator.js +++ b/src/subscription/__tests__/eventEmitterAsyncIterator.js @@ -53,7 +53,9 @@ export default function eventEmitterAsyncIterator( } } - return { + /* TODO: Flow doesn't support symbols as keys: + https://github.com/facebook/flow/issues/3258 */ + return ({ next() { return listening ? pullValue() : this.return(); }, @@ -68,5 +70,5 @@ export default function eventEmitterAsyncIterator( [$$asyncIterator]() { return this; }, - }; + }: any); } diff --git a/src/subscription/asyncIteratorReject.js b/src/subscription/asyncIteratorReject.js index 85f0881167..4aac773fdd 100644 --- a/src/subscription/asyncIteratorReject.js +++ b/src/subscription/asyncIteratorReject.js @@ -18,7 +18,9 @@ import { $$asyncIterator } from 'iterall'; */ export default function asyncIteratorReject(error: Error): AsyncIterator { let isComplete = false; - return { + /* TODO: Flow doesn't support symbols as keys: + https://github.com/facebook/flow/issues/3258 */ + return ({ next() { const result = isComplete ? Promise.resolve({ value: undefined, done: true }) : @@ -37,5 +39,5 @@ export default function asyncIteratorReject(error: Error): AsyncIterator { [$$asyncIterator]() { return this; }, - }; + }: any); } diff --git a/src/subscription/mapAsyncIterator.js b/src/subscription/mapAsyncIterator.js index 5b66eff2b0..c31d74c6cd 100644 --- a/src/subscription/mapAsyncIterator.js +++ b/src/subscription/mapAsyncIterator.js @@ -45,7 +45,9 @@ export default function mapAsyncIterator( asyncMapValue(error, reject).then(iteratorResult, abruptClose); } - return { + /* TODO: Flow doesn't support symbols as keys: + https://github.com/facebook/flow/issues/3258 */ + return ({ next() { return iterator.next().then(mapResult, mapReject); }, @@ -63,7 +65,7 @@ export default function mapAsyncIterator( [$$asyncIterator]() { return this; }, - }; + }: any); } function asyncMapValue( diff --git a/src/type/definition.js b/src/type/definition.js index 17c3c16e87..5aa4b9f1ee 100644 --- a/src/type/definition.js +++ b/src/type/definition.js @@ -70,17 +70,18 @@ export function assertType(type: mixed): GraphQLType { /** * These types may be used as input types for arguments and directives. */ -export type GraphQLInputType = +type GraphQLInputType_ = GraphQLScalarType | GraphQLEnumType | GraphQLInputObjectType | - GraphQLList | + GraphQLList | GraphQLNonNull< GraphQLScalarType | GraphQLEnumType | GraphQLInputObjectType | - GraphQLList + GraphQLList >; +export type GraphQLInputType = GraphQLInputType_<*>; export function isInputType(type: ?GraphQLType): boolean %checks { return ( @@ -210,14 +211,15 @@ export function assertAbstractType(type: ?GraphQLType): GraphQLAbstractType { /** * These types can all accept null as a value. */ -export type GraphQLNullableType = +type GraphQLNullableType_ = GraphQLScalarType | GraphQLObjectType | GraphQLInterfaceType | GraphQLUnionType | GraphQLEnumType | GraphQLInputObjectType | - GraphQLList<*>; + GraphQLList; +export type GraphQLNullableType = GraphQLNullableType_<*>; export function getNullableType( type: ?T diff --git a/yarn.lock b/yarn.lock index fa41a46677..7f33a88ddb 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1224,9 +1224,9 @@ flat-cache@^1.2.1: graceful-fs "^4.1.2" write "^0.2.1" -flow-bin@0.52.0: - version "0.52.0" - resolved "https://registry.yarnpkg.com/flow-bin/-/flow-bin-0.52.0.tgz#b6d9abe8bcd1ee5c62df386451a4e2553cadc3a3" +flow-bin@^0.54.0: + version "0.54.0" + resolved "https://registry.yarnpkg.com/flow-bin/-/flow-bin-0.54.0.tgz#f2fb0478e9e99702b623c9ed84079a39903bba77" for-in@^1.0.1: version "1.0.2" @@ -1332,7 +1332,7 @@ glob-parent@^2.0.0: dependencies: is-glob "^2.0.0" -glob@7.1.1, glob@^7.0.0, glob@^7.0.5: +glob@7.1.1, glob@^7.0.0: version "7.1.1" resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.1.tgz#805211df04faaf1c63a3600306cdf5ade50b2ec8" dependencies: @@ -1353,7 +1353,7 @@ glob@^5.0.15: once "^1.3.0" path-is-absolute "^1.0.0" -glob@^7.0.3, glob@^7.1.2: +glob@^7.0.3, glob@^7.0.5, glob@^7.1.2: version "7.1.2" resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.2.tgz#c19c9df9a028702d678612384a6552404c636d15" dependencies: @@ -1691,14 +1691,14 @@ js-tokens@^3.0.0: version "3.0.1" resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-3.0.1.tgz#08e9f132484a2c45a30907e9dc4d5567b7f114d7" -js-yaml@3.6.1, js-yaml@3.x: +js-yaml@3.6.1: version "3.6.1" resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-3.6.1.tgz#6e5fe67d8b205ce4d22fad05b7781e8dadcc4b30" dependencies: argparse "^1.0.7" esprima "^2.6.0" -js-yaml@^3.9.1: +js-yaml@3.x, js-yaml@^3.9.1: version "3.9.1" resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-3.9.1.tgz#08775cebdfdd359209f0d2acd383c8f86a6904a0" dependencies: