Skip to content

Commit fbed2c2

Browse files
Replace all instances of Flow existential type (#2284)
See: https://flow.org/en/docs/types/utilities/#toc-existential-type
1 parent 58e2f5f commit fbed2c2

File tree

2 files changed

+24
-24
lines changed

2 files changed

+24
-24
lines changed

.flowconfig

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ untyped-type-import=error
1919
nonstrict-import=off
2020
untyped-import=off
2121
unclear-type=off
22-
deprecated-type=off
22+
deprecated-type=error
2323
deprecated-utility=error
2424
dynamic-export=off
2525
unsafe-getters-setters=error

src/type/definition.js

+23-23
Original file line numberDiff line numberDiff line change
@@ -546,14 +546,14 @@ function undefineIfEmpty<T>(arr: ?$ReadOnlyArray<T>): ?$ReadOnlyArray<T> {
546546
export class GraphQLScalarType {
547547
name: string;
548548
description: ?string;
549-
serialize: GraphQLScalarSerializer<*>;
550-
parseValue: GraphQLScalarValueParser<*>;
551-
parseLiteral: GraphQLScalarLiteralParser<*>;
549+
serialize: GraphQLScalarSerializer<mixed>;
550+
parseValue: GraphQLScalarValueParser<mixed>;
551+
parseLiteral: GraphQLScalarLiteralParser<mixed>;
552552
extensions: ?ReadOnlyObjMap<mixed>;
553553
astNode: ?ScalarTypeDefinitionNode;
554554
extensionASTNodes: ?$ReadOnlyArray<ScalarTypeExtensionNode>;
555555

556-
constructor(config: GraphQLScalarTypeConfig<*, *>): void {
556+
constructor(config: GraphQLScalarTypeConfig<mixed, mixed>): void {
557557
const parseValue = config.parseValue || identityFunc;
558558
this.name = config.name;
559559
this.description = config.description;
@@ -581,10 +581,10 @@ export class GraphQLScalarType {
581581
}
582582
583583
toConfig(): {|
584-
...GraphQLScalarTypeConfig<*, *>,
585-
serialize: GraphQLScalarSerializer<*>,
586-
parseValue: GraphQLScalarValueParser<*>,
587-
parseLiteral: GraphQLScalarLiteralParser<*>,
584+
...GraphQLScalarTypeConfig<mixed, mixed>,
585+
serialize: GraphQLScalarSerializer<mixed>,
586+
parseValue: GraphQLScalarValueParser<mixed>,
587+
parseLiteral: GraphQLScalarLiteralParser<mixed>,
588588
extensions: ?ReadOnlyObjMap<mixed>,
589589
extensionASTNodes: ?$ReadOnlyArray<ScalarTypeExtensionNode>,
590590
|} {
@@ -670,15 +670,15 @@ export type GraphQLScalarTypeConfig<TInternal, TExternal> = {|
670670
export class GraphQLObjectType {
671671
name: string;
672672
description: ?string;
673-
isTypeOf: ?GraphQLIsTypeOfFn<*, *>;
673+
isTypeOf: ?GraphQLIsTypeOfFn<any, any>;
674674
extensions: ?ReadOnlyObjMap<mixed>;
675675
astNode: ?ObjectTypeDefinitionNode;
676676
extensionASTNodes: ?$ReadOnlyArray<ObjectTypeExtensionNode>;
677677
678-
_fields: Thunk<GraphQLFieldMap<*, *>>;
678+
_fields: Thunk<GraphQLFieldMap<any, any>>;
679679
_interfaces: Thunk<Array<GraphQLInterfaceType>>;
680680
681-
constructor(config: GraphQLObjectTypeConfig<*, *>): void {
681+
constructor(config: GraphQLObjectTypeConfig<any, any>): void {
682682
this.name = config.name;
683683
this.description = config.description;
684684
this.isTypeOf = config.isTypeOf;
@@ -696,7 +696,7 @@ export class GraphQLObjectType {
696696
);
697697
}
698698

699-
getFields(): GraphQLFieldMap<*, *> {
699+
getFields(): GraphQLFieldMap<any, any> {
700700
if (typeof this._fields === 'function') {
701701
this._fields = this._fields();
702702
}
@@ -711,9 +711,9 @@ export class GraphQLObjectType {
711711
}
712712

713713
toConfig(): {|
714-
...GraphQLObjectTypeConfig<*, *>,
714+
...GraphQLObjectTypeConfig<any, any>,
715715
interfaces: Array<GraphQLInterfaceType>,
716-
fields: GraphQLFieldConfigMap<*, *>,
716+
fields: GraphQLFieldConfigMap<any, any>,
717717
extensions: ?ReadOnlyObjMap<mixed>,
718718
extensionASTNodes: ?$ReadOnlyArray<ObjectTypeExtensionNode>,
719719
|} {
@@ -975,15 +975,15 @@ export type GraphQLFieldMap<TSource, TContext> = ObjMap<
975975
export class GraphQLInterfaceType {
976976
name: string;
977977
description: ?string;
978-
resolveType: ?GraphQLTypeResolver<*, *>;
978+
resolveType: ?GraphQLTypeResolver<any, any>;
979979
extensions: ?ReadOnlyObjMap<mixed>;
980980
astNode: ?InterfaceTypeDefinitionNode;
981981
extensionASTNodes: ?$ReadOnlyArray<InterfaceTypeExtensionNode>;
982982

983-
_fields: Thunk<GraphQLFieldMap<*, *>>;
983+
_fields: Thunk<GraphQLFieldMap<any, any>>;
984984
_interfaces: Thunk<Array<GraphQLInterfaceType>>;
985985

986-
constructor(config: GraphQLInterfaceTypeConfig<*, *>): void {
986+
constructor(config: GraphQLInterfaceTypeConfig<any, any>): void {
987987
this.name = config.name;
988988
this.description = config.description;
989989
this.resolveType = config.resolveType;
@@ -1001,7 +1001,7 @@ export class GraphQLInterfaceType {
10011001
);
10021002
}
10031003

1004-
getFields(): GraphQLFieldMap<*, *> {
1004+
getFields(): GraphQLFieldMap<any, any> {
10051005
if (typeof this._fields === 'function') {
10061006
this._fields = this._fields();
10071007
}
@@ -1016,9 +1016,9 @@ export class GraphQLInterfaceType {
10161016
}
10171017

10181018
toConfig(): {|
1019-
...GraphQLInterfaceTypeConfig<*, *>,
1019+
...GraphQLInterfaceTypeConfig<any, any>,
10201020
interfaces: Array<GraphQLInterfaceType>,
1021-
fields: GraphQLFieldConfigMap<*, *>,
1021+
fields: GraphQLFieldConfigMap<any, any>,
10221022
extensions: ?ReadOnlyObjMap<mixed>,
10231023
extensionASTNodes: ?$ReadOnlyArray<InterfaceTypeExtensionNode>,
10241024
|} {
@@ -1085,14 +1085,14 @@ export type GraphQLInterfaceTypeConfig<TSource, TContext> = {|
10851085
export class GraphQLUnionType {
10861086
name: string;
10871087
description: ?string;
1088-
resolveType: ?GraphQLTypeResolver<*, *>;
1088+
resolveType: ?GraphQLTypeResolver<any, any>;
10891089
extensions: ?ReadOnlyObjMap<mixed>;
10901090
astNode: ?UnionTypeDefinitionNode;
10911091
extensionASTNodes: ?$ReadOnlyArray<UnionTypeExtensionNode>;
10921092

10931093
_types: Thunk<Array<GraphQLObjectType>>;
10941094

1095-
constructor(config: GraphQLUnionTypeConfig<*, *>): void {
1095+
constructor(config: GraphQLUnionTypeConfig<any, any>): void {
10961096
this.name = config.name;
10971097
this.description = config.description;
10981098
this.resolveType = config.resolveType;
@@ -1117,7 +1117,7 @@ export class GraphQLUnionType {
11171117
}
11181118

11191119
toConfig(): {|
1120-
...GraphQLUnionTypeConfig<*, *>,
1120+
...GraphQLUnionTypeConfig<any, any>,
11211121
types: Array<GraphQLObjectType>,
11221122
extensions: ?ReadOnlyObjMap<mixed>,
11231123
extensionASTNodes: ?$ReadOnlyArray<UnionTypeExtensionNode>,

0 commit comments

Comments
 (0)