Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .flowconfig
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,6 @@

[options]
experimental.const_params=true

[version]
^0.54.0
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
6 changes: 4 additions & 2 deletions src/subscription/__tests__/eventEmitterAsyncIterator.js
Original file line number Diff line number Diff line change
Expand Up @@ -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();
},
Expand All @@ -68,5 +70,5 @@ export default function eventEmitterAsyncIterator(
[$$asyncIterator]() {
return this;
},
};
}: any);
}
6 changes: 4 additions & 2 deletions src/subscription/asyncIteratorReject.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,9 @@ import { $$asyncIterator } from 'iterall';
*/
export default function asyncIteratorReject(error: Error): AsyncIterator<void> {
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 }) :
Expand All @@ -37,5 +39,5 @@ export default function asyncIteratorReject(error: Error): AsyncIterator<void> {
[$$asyncIterator]() {
return this;
},
};
}: any);
}
6 changes: 4 additions & 2 deletions src/subscription/mapAsyncIterator.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,9 @@ export default function mapAsyncIterator<T, U>(
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);
},
Expand All @@ -63,7 +65,7 @@ export default function mapAsyncIterator<T, U>(
[$$asyncIterator]() {
return this;
},
};
}: any);
}

function asyncMapValue<T, U>(
Expand Down
12 changes: 7 additions & 5 deletions src/type/definition.js
Original file line number Diff line number Diff line change
Expand Up @@ -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_<T> =
GraphQLScalarType |
GraphQLEnumType |
GraphQLInputObjectType |
GraphQLList<GraphQLInputType> |
GraphQLList<T> |
GraphQLNonNull<
GraphQLScalarType |
GraphQLEnumType |
GraphQLInputObjectType |
GraphQLList<GraphQLInputType>
GraphQLList<T>
>;
export type GraphQLInputType = GraphQLInputType_<*>;

export function isInputType(type: ?GraphQLType): boolean %checks {
return (
Expand Down Expand Up @@ -210,14 +211,15 @@ export function assertAbstractType(type: ?GraphQLType): GraphQLAbstractType {
/**
* These types can all accept null as a value.
*/
export type GraphQLNullableType =
type GraphQLNullableType_<T> =
GraphQLScalarType |
GraphQLObjectType |
GraphQLInterfaceType |
GraphQLUnionType |
GraphQLEnumType |
GraphQLInputObjectType |
GraphQLList<*>;
GraphQLList<T>;
export type GraphQLNullableType = GraphQLNullableType_<*>;

export function getNullableType<T: GraphQLType>(
type: ?T
Expand Down
14 changes: 7 additions & 7 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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:
Expand All @@ -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:
Expand Down Expand Up @@ -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:
Expand Down