Skip to content

Replace all instances of Flow existential type #2284

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Dec 14, 2019
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
2 changes: 1 addition & 1 deletion .flowconfig
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ untyped-type-import=error
nonstrict-import=off
untyped-import=off
unclear-type=off
deprecated-type=off
deprecated-type=error
deprecated-utility=error
dynamic-export=off
unsafe-getters-setters=error
Expand Down
46 changes: 23 additions & 23 deletions src/type/definition.js
Original file line number Diff line number Diff line change
Expand Up @@ -546,14 +546,14 @@ function undefineIfEmpty<T>(arr: ?$ReadOnlyArray<T>): ?$ReadOnlyArray<T> {
export class GraphQLScalarType {
name: string;
description: ?string;
serialize: GraphQLScalarSerializer<*>;
parseValue: GraphQLScalarValueParser<*>;
parseLiteral: GraphQLScalarLiteralParser<*>;
serialize: GraphQLScalarSerializer<mixed>;
parseValue: GraphQLScalarValueParser<mixed>;
parseLiteral: GraphQLScalarLiteralParser<mixed>;
extensions: ?ReadOnlyObjMap<mixed>;
astNode: ?ScalarTypeDefinitionNode;
extensionASTNodes: ?$ReadOnlyArray<ScalarTypeExtensionNode>;

constructor(config: GraphQLScalarTypeConfig<*, *>): void {
constructor(config: GraphQLScalarTypeConfig<mixed, mixed>): void {
const parseValue = config.parseValue || identityFunc;
this.name = config.name;
this.description = config.description;
Expand Down Expand Up @@ -581,10 +581,10 @@ export class GraphQLScalarType {
}

toConfig(): {|
...GraphQLScalarTypeConfig<*, *>,
serialize: GraphQLScalarSerializer<*>,
parseValue: GraphQLScalarValueParser<*>,
parseLiteral: GraphQLScalarLiteralParser<*>,
...GraphQLScalarTypeConfig<mixed, mixed>,
serialize: GraphQLScalarSerializer<mixed>,
parseValue: GraphQLScalarValueParser<mixed>,
parseLiteral: GraphQLScalarLiteralParser<mixed>,
extensions: ?ReadOnlyObjMap<mixed>,
extensionASTNodes: ?$ReadOnlyArray<ScalarTypeExtensionNode>,
|} {
Expand Down Expand Up @@ -670,15 +670,15 @@ export type GraphQLScalarTypeConfig<TInternal, TExternal> = {|
export class GraphQLObjectType {
name: string;
description: ?string;
isTypeOf: ?GraphQLIsTypeOfFn<*, *>;
isTypeOf: ?GraphQLIsTypeOfFn<any, any>;
extensions: ?ReadOnlyObjMap<mixed>;
astNode: ?ObjectTypeDefinitionNode;
extensionASTNodes: ?$ReadOnlyArray<ObjectTypeExtensionNode>;

_fields: Thunk<GraphQLFieldMap<*, *>>;
_fields: Thunk<GraphQLFieldMap<any, any>>;
_interfaces: Thunk<Array<GraphQLInterfaceType>>;

constructor(config: GraphQLObjectTypeConfig<*, *>): void {
constructor(config: GraphQLObjectTypeConfig<any, any>): void {
this.name = config.name;
this.description = config.description;
this.isTypeOf = config.isTypeOf;
Expand All @@ -696,7 +696,7 @@ export class GraphQLObjectType {
);
}

getFields(): GraphQLFieldMap<*, *> {
getFields(): GraphQLFieldMap<any, any> {
if (typeof this._fields === 'function') {
this._fields = this._fields();
}
Expand All @@ -711,9 +711,9 @@ export class GraphQLObjectType {
}

toConfig(): {|
...GraphQLObjectTypeConfig<*, *>,
...GraphQLObjectTypeConfig<any, any>,
interfaces: Array<GraphQLInterfaceType>,
fields: GraphQLFieldConfigMap<*, *>,
fields: GraphQLFieldConfigMap<any, any>,
extensions: ?ReadOnlyObjMap<mixed>,
extensionASTNodes: ?$ReadOnlyArray<ObjectTypeExtensionNode>,
|} {
Expand Down Expand Up @@ -975,15 +975,15 @@ export type GraphQLFieldMap<TSource, TContext> = ObjMap<
export class GraphQLInterfaceType {
name: string;
description: ?string;
resolveType: ?GraphQLTypeResolver<*, *>;
resolveType: ?GraphQLTypeResolver<any, any>;
extensions: ?ReadOnlyObjMap<mixed>;
astNode: ?InterfaceTypeDefinitionNode;
extensionASTNodes: ?$ReadOnlyArray<InterfaceTypeExtensionNode>;

_fields: Thunk<GraphQLFieldMap<*, *>>;
_fields: Thunk<GraphQLFieldMap<any, any>>;
_interfaces: Thunk<Array<GraphQLInterfaceType>>;

constructor(config: GraphQLInterfaceTypeConfig<*, *>): void {
constructor(config: GraphQLInterfaceTypeConfig<any, any>): void {
this.name = config.name;
this.description = config.description;
this.resolveType = config.resolveType;
Expand All @@ -1001,7 +1001,7 @@ export class GraphQLInterfaceType {
);
}

getFields(): GraphQLFieldMap<*, *> {
getFields(): GraphQLFieldMap<any, any> {
if (typeof this._fields === 'function') {
this._fields = this._fields();
}
Expand All @@ -1016,9 +1016,9 @@ export class GraphQLInterfaceType {
}

toConfig(): {|
...GraphQLInterfaceTypeConfig<*, *>,
...GraphQLInterfaceTypeConfig<any, any>,
interfaces: Array<GraphQLInterfaceType>,
fields: GraphQLFieldConfigMap<*, *>,
fields: GraphQLFieldConfigMap<any, any>,
extensions: ?ReadOnlyObjMap<mixed>,
extensionASTNodes: ?$ReadOnlyArray<InterfaceTypeExtensionNode>,
|} {
Expand Down Expand Up @@ -1085,14 +1085,14 @@ export type GraphQLInterfaceTypeConfig<TSource, TContext> = {|
export class GraphQLUnionType {
name: string;
description: ?string;
resolveType: ?GraphQLTypeResolver<*, *>;
resolveType: ?GraphQLTypeResolver<any, any>;
extensions: ?ReadOnlyObjMap<mixed>;
astNode: ?UnionTypeDefinitionNode;
extensionASTNodes: ?$ReadOnlyArray<UnionTypeExtensionNode>;

_types: Thunk<Array<GraphQLObjectType>>;

constructor(config: GraphQLUnionTypeConfig<*, *>): void {
constructor(config: GraphQLUnionTypeConfig<any, any>): void {
this.name = config.name;
this.description = config.description;
this.resolveType = config.resolveType;
Expand All @@ -1117,7 +1117,7 @@ export class GraphQLUnionType {
}

toConfig(): {|
...GraphQLUnionTypeConfig<*, *>,
...GraphQLUnionTypeConfig<any, any>,
types: Array<GraphQLObjectType>,
extensions: ?ReadOnlyObjMap<mixed>,
extensionASTNodes: ?$ReadOnlyArray<UnionTypeExtensionNode>,
Expand Down