Skip to content

Commit 5b88392

Browse files
Update Flow to 0.111 (#2251)
1 parent b9a55cd commit 5b88392

File tree

5 files changed

+18
-16
lines changed

5 files changed

+18
-16
lines changed

.flowconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,4 +38,4 @@ suppress_comment=\\(.\\|\n\\)*\\$FlowFixMe\\($\\|[^(]\\|(\\(<VERSION>\\)?)\\)
3838
suppress_comment=\\(.\\|\n\\)*\\$DisableFlowOnNegativeTest
3939

4040
[version]
41-
^0.110.0
41+
^0.111.0

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@
5555
"dtslint": "1.0.3",
5656
"eslint": "6.6.0",
5757
"eslint-plugin-flowtype": "4.3.0",
58-
"flow-bin": "0.110.0",
58+
"flow-bin": "0.111.3",
5959
"mocha": "6.2.2",
6060
"nyc": "14.1.1",
6161
"prettier": "1.18.2"

src/type/__tests__/validation-test.js

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -872,52 +872,50 @@ describe('Type System: Enum types must be well defined', () => {
872872
});
873873

874874
it('rejects an Enum type with incorrectly named values', () => {
875-
function schemaWithEnum(name) {
875+
function schemaWithEnum(values) {
876876
return schemaWithFieldType(
877877
new GraphQLEnumType({
878878
name: 'SomeEnum',
879-
values: {
880-
[name]: {},
881-
},
879+
values,
882880
}),
883881
);
884882
}
885883

886-
const schema1 = schemaWithEnum('#value');
884+
const schema1 = schemaWithEnum({ '#value': {} });
887885
expect(validateSchema(schema1)).to.deep.equal([
888886
{
889887
message:
890888
'Names must match /^[_a-zA-Z][_a-zA-Z0-9]*$/ but "#value" does not.',
891889
},
892890
]);
893891

894-
const schema2 = schemaWithEnum('1value');
892+
const schema2 = schemaWithEnum({ '1value': {} });
895893
expect(validateSchema(schema2)).to.deep.equal([
896894
{
897895
message:
898896
'Names must match /^[_a-zA-Z][_a-zA-Z0-9]*$/ but "1value" does not.',
899897
},
900898
]);
901899

902-
const schema3 = schemaWithEnum('KEBAB-CASE');
900+
const schema3 = schemaWithEnum({ 'KEBAB-CASE': {} });
903901
expect(validateSchema(schema3)).to.deep.equal([
904902
{
905903
message:
906904
'Names must match /^[_a-zA-Z][_a-zA-Z0-9]*$/ but "KEBAB-CASE" does not.',
907905
},
908906
]);
909907

910-
const schema4 = schemaWithEnum('true');
908+
const schema4 = schemaWithEnum({ true: {} });
911909
expect(validateSchema(schema4)).to.deep.equal([
912910
{ message: 'Enum type SomeEnum cannot include value: true.' },
913911
]);
914912

915-
const schema5 = schemaWithEnum('false');
913+
const schema5 = schemaWithEnum({ false: {} });
916914
expect(validateSchema(schema5)).to.deep.equal([
917915
{ message: 'Enum type SomeEnum cannot include value: false.' },
918916
]);
919917

920-
const schema6 = schemaWithEnum('null');
918+
const schema6 = schemaWithEnum({ null: {} });
921919
expect(validateSchema(schema6)).to.deep.equal([
922920
{ message: 'Enum type SomeEnum cannot include value: null.' },
923921
]);

src/utilities/extendSchema.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -257,6 +257,7 @@ export function extendSchema(
257257
...field,
258258
type: replaceType(field.type),
259259
})),
260+
// $FlowFixMe Bug in Flow, see https://github.com/facebook/flow/issues/8178
260261
...astBuilder.buildInputFieldMap(extensions),
261262
}),
262263
extensionASTNodes: concatMaybeArrays(
@@ -274,6 +275,7 @@ export function extendSchema(
274275
...config,
275276
values: {
276277
...config.values,
278+
// $FlowFixMe Bug in Flow, see https://github.com/facebook/flow/issues/8178
277279
...astBuilder.buildEnumValueMap(extensions),
278280
},
279281
extensionASTNodes: concatMaybeArrays(
@@ -308,6 +310,7 @@ export function extendSchema(
308310
],
309311
fields: () => ({
310312
...mapValue(config.fields, extendField),
313+
// $FlowFixMe Bug in Flow, see https://github.com/facebook/flow/issues/8178
311314
...astBuilder.buildFieldMap(extensions),
312315
}),
313316
extensionASTNodes: concatMaybeArrays(
@@ -331,6 +334,7 @@ export function extendSchema(
331334
],
332335
fields: () => ({
333336
...mapValue(config.fields, extendField),
337+
// $FlowFixMe Bug in Flow, see https://github.com/facebook/flow/issues/8178
334338
...astBuilder.buildFieldMap(extensions),
335339
}),
336340
extensionASTNodes: concatMaybeArrays(

yarn.lock

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1461,10 +1461,10 @@ flatted@^2.0.0:
14611461
resolved "https://registry.yarnpkg.com/flatted/-/flatted-2.0.1.tgz#69e57caa8f0eacbc281d2e2cb458d46fdb449e08"
14621462
integrity sha512-a1hQMktqW9Nmqr5aktAux3JMNqaucxGcjtjWnZLHX7yyPCmlSV3M54nGYbqT8K+0GhF3NBgmJCc3ma+WOgX8Jg==
14631463

1464-
flow-bin@0.110.0:
1465-
version "0.110.0"
1466-
resolved "https://registry.yarnpkg.com/flow-bin/-/flow-bin-0.110.0.tgz#c6c140e239f662839d8f61b64b7b911f12d3306c"
1467-
integrity sha512-mmdEPEMoTuX+mguy/tjRlOlCtPfVdXZQeMgCAsEDVDgWMA5vwWhM2y653OcJiKX38t4gtZ2e/MNVo0qzyYeZDQ==
1464+
flow-bin@0.111.3:
1465+
version "0.111.3"
1466+
resolved "https://registry.yarnpkg.com/flow-bin/-/flow-bin-0.111.3.tgz#8653a413400ebc966097a47c81fb4e6b722a5921"
1467+
integrity sha512-Gn27aRTjSFicukZ/pq3raRERmSk9UWszhIK9eNtj6843L54YtK+jk2OkQWV70+VKi9LmWyfItCkhwoIVy7L2lA==
14681468

14691469
foreground-child@^1.5.6:
14701470
version "1.5.6"

0 commit comments

Comments
 (0)