diff --git a/src/execution/execute.js b/src/execution/execute.js index 0232d331cd..4bbf745087 100644 --- a/src/execution/execute.js +++ b/src/execution/execute.js @@ -293,8 +293,8 @@ export function buildExecutionContext( contextValue: mixed, rawVariableValues: ?{ +[variable: string]: mixed, ... }, operationName: ?string, - fieldResolver: ?GraphQLFieldResolver, - typeResolver?: ?GraphQLTypeResolver, + fieldResolver: ?GraphQLFieldResolver, + typeResolver?: ?GraphQLTypeResolver, ): $ReadOnlyArray | ExecutionContext { const errors: Array = []; let operation: OperationDefinitionNode | void; @@ -682,7 +682,7 @@ function resolveField( export function buildResolveInfo( exeContext: ExecutionContext, - fieldDef: GraphQLField<*, *>, + fieldDef: GraphQLField, fieldNodes: $ReadOnlyArray, parentType: GraphQLObjectType, path: ResponsePath, @@ -705,12 +705,12 @@ export function buildResolveInfo( // Isolates the "ReturnOrAbrupt" behavior to not de-opt the `resolveField` // function. Returns the result of resolveFn or the abrupt-return Error object. -export function resolveFieldValueOrError( +export function resolveFieldValueOrError( exeContext: ExecutionContext, - fieldDef: GraphQLField, + fieldDef: GraphQLField, fieldNodes: $ReadOnlyArray, - resolveFn: GraphQLFieldResolver, - source: TSource, + resolveFn: GraphQLFieldResolver, + source: mixed, info: GraphQLResolveInfo, ): Error | mixed { try { @@ -1165,7 +1165,7 @@ function _collectSubfields( * Otherwise, test each possible type for the abstract type by calling * isTypeOf for the object being coerced, returning the first type that matches. */ -export const defaultTypeResolver: GraphQLTypeResolver = function( +export const defaultTypeResolver: GraphQLTypeResolver = function( value, contextValue, info, @@ -1211,12 +1211,10 @@ export const defaultTypeResolver: GraphQLTypeResolver = function( * and returns it as the result, or if it's a function, returns the result * of calling that function while passing along args and context value. */ -export const defaultFieldResolver: GraphQLFieldResolver = function( - source, - args, - contextValue, - info, -) { +export const defaultFieldResolver: GraphQLFieldResolver< + mixed, + mixed, +> = function(source: any, args, contextValue, info) { // ensure source is a value for which property access is acceptable. if (isObjectLike(source) || typeof source === 'function') { const property = source[info.fieldName]; @@ -1240,7 +1238,7 @@ export function getFieldDef( schema: GraphQLSchema, parentType: GraphQLObjectType, fieldName: string, -): ?GraphQLField<*, *> { +): ?GraphQLField { if ( fieldName === SchemaMetaFieldDef.name && schema.getQueryType() === parentType diff --git a/src/execution/values.js b/src/execution/values.js index 87fdd6f528..b941374fbf 100644 --- a/src/execution/values.js +++ b/src/execution/values.js @@ -119,7 +119,7 @@ export function getVariableValues( * Object prototype. */ export function getArgumentValues( - def: GraphQLField<*, *> | GraphQLDirective, + def: GraphQLField | GraphQLDirective, node: FieldNode | DirectiveNode, variableValues?: ?ObjMap, ): { [argument: string]: mixed, ... } { diff --git a/src/jsutils/defineToStringTag.js b/src/jsutils/defineToStringTag.js index f14c3308ba..f3941ab71e 100644 --- a/src/jsutils/defineToStringTag.js +++ b/src/jsutils/defineToStringTag.js @@ -13,7 +13,7 @@ * typically one of your own creation through the class keyword; `class A {}`, * for example. */ -export default function defineToStringTag(classObject: Class): void { +export default function defineToStringTag(classObject: Class): void { if (typeof Symbol === 'function' && Symbol.toStringTag) { Object.defineProperty(classObject.prototype, Symbol.toStringTag, { get() { diff --git a/src/language/lexer.js b/src/language/lexer.js index af70d6274d..e9de3152dd 100644 --- a/src/language/lexer.js +++ b/src/language/lexer.js @@ -172,7 +172,7 @@ function printCharCode(code) { * punctuators immediately or calls the appropriate helper function for more * complicated tokens. */ -function readToken(lexer: Lexer<*>, prev: Token): Token { +function readToken(lexer: Lexer, prev: Token): Token { const source = lexer.source; const body = source.body; const bodyLength = body.length; @@ -339,7 +339,7 @@ function unexpectedCharacterMessage(code) { function positionAfterWhitespace( body: string, startPosition: number, - lexer: Lexer<*>, + lexer: Lexer, ): number { const bodyLength = body.length; let position = startPosition; diff --git a/src/type/definition.js b/src/type/definition.js index 5a899c4179..5e68cba06e 100644 --- a/src/type/definition.js +++ b/src/type/definition.js @@ -727,7 +727,7 @@ defineToStringTag(GraphQLObjectType); defineToJSON(GraphQLObjectType); function defineInterfaces( - config: GraphQLObjectTypeConfig<*, *>, + config: GraphQLObjectTypeConfig, ): Array { const interfaces = resolveThunk(config.interfaces) || []; invariant( @@ -1096,7 +1096,7 @@ defineToStringTag(GraphQLUnionType); defineToJSON(GraphQLUnionType); function defineTypes( - config: GraphQLUnionTypeConfig<*, *>, + config: GraphQLUnionTypeConfig, ): Array { const types = resolveThunk(config.types) || []; invariant( diff --git a/src/utilities/TypeInfo.js b/src/utilities/TypeInfo.js index 1f2c8d8873..0bea95e50d 100644 --- a/src/utilities/TypeInfo.js +++ b/src/utilities/TypeInfo.js @@ -42,7 +42,7 @@ export class TypeInfo { _typeStack: Array; _parentTypeStack: Array; _inputTypeStack: Array; - _fieldDefStack: Array>; + _fieldDefStack: Array>; _defaultValueStack: Array; _directive: ?GraphQLDirective; _argument: ?GraphQLArgument; @@ -106,7 +106,7 @@ export class TypeInfo { } } - getFieldDef(): ?GraphQLField<*, *> { + getFieldDef(): ?GraphQLField { if (this._fieldDefStack.length > 0) { return this._fieldDefStack[this._fieldDefStack.length - 1]; } @@ -293,7 +293,7 @@ function getFieldDef( schema: GraphQLSchema, parentType: GraphQLType, fieldNode: FieldNode, -): ?GraphQLField<*, *> { +): ?GraphQLField { const name = fieldNode.name.value; if ( name === SchemaMetaFieldDef.name && diff --git a/src/utilities/findBreakingChanges.js b/src/utilities/findBreakingChanges.js index 3e3f425cf4..dd7a4630ab 100644 --- a/src/utilities/findBreakingChanges.js +++ b/src/utilities/findBreakingChanges.js @@ -359,8 +359,8 @@ function findFieldChanges( function findArgChanges( oldType: GraphQLObjectType | GraphQLInterfaceType, - oldField: GraphQLField<*, *>, - newField: GraphQLField<*, *>, + oldField: GraphQLField, + newField: GraphQLField, ): Array { const schemaChanges = []; const argsDiff = diff(oldField.args, newField.args); diff --git a/src/validation/ValidationContext.js b/src/validation/ValidationContext.js index a993d4033d..35a594996d 100644 --- a/src/validation/ValidationContext.js +++ b/src/validation/ValidationContext.js @@ -227,7 +227,7 @@ export class ValidationContext extends ASTValidationContext { return this._typeInfo.getParentInputType(); } - getFieldDef(): ?GraphQLField<*, *> { + getFieldDef(): ?GraphQLField { return this._typeInfo.getFieldDef(); } diff --git a/src/validation/rules/OverlappingFieldsCanBeMerged.js b/src/validation/rules/OverlappingFieldsCanBeMerged.js index a7c23cc0a6..093942d58d 100644 --- a/src/validation/rules/OverlappingFieldsCanBeMerged.js +++ b/src/validation/rules/OverlappingFieldsCanBeMerged.js @@ -100,7 +100,11 @@ type ConflictReason = [string, ConflictReasonMessage]; // Reason is a string, or a nested list of conflicts. type ConflictReasonMessage = string | Array; // Tuple defining a field node in a context. -type NodeAndDef = [GraphQLCompositeType, FieldNode, ?GraphQLField<*, *>]; +type NodeAndDef = [ + GraphQLCompositeType, + FieldNode, + ?GraphQLField, +]; // Map of array of those. type NodeAndDefCollection = ObjMap>;