@@ -95,10 +95,10 @@ import {
9595export type ExecutionContext = {
9696 schema : GraphQLSchema ,
9797 fragments : ObjMap < FragmentDefinitionNode > ,
98- rootValue : mixed ,
99- contextValue : mixed ,
98+ rootValue : unknown ,
99+ contextValue : unknown ,
100100 operation : OperationDefinitionNode ,
101- variableValues : { [ variable : string ] : mixed , ... } ,
101+ variableValues : { [ variable : string ] : unknown , ... } ,
102102 fieldResolver : GraphQLFieldResolver < any , any > ,
103103 typeResolver : GraphQLTypeResolver < any , any > ,
104104 errors : Array < GraphQLError > ,
@@ -113,22 +113,22 @@ export type ExecutionContext = {
113113 */
114114export type ExecutionResult = {
115115 errors ?: ReadonlyArray < GraphQLError > ,
116- data ?: ObjMap < mixed > | null ,
117- extensions ?: ObjMap < mixed > ,
116+ data ?: ObjMap < unknown > | null ,
117+ extensions ?: ObjMap < unknown > ,
118118} ;
119119
120120export type FormattedExecutionResult = {
121121 errors ?: ReadonlyArray < GraphQLFormattedError > ,
122- data ?: ObjMap < mixed > | null ,
123- extensions ?: ObjMap < mixed > ,
122+ data ?: ObjMap < unknown > | null ,
123+ extensions ?: ObjMap < unknown > ,
124124} ;
125125
126126export type ExecutionArgs = {
127127 schema : GraphQLSchema ,
128128 document : DocumentNode ,
129129 rootValue ?: mixed ,
130130 contextValue ?: mixed ,
131- variableValues ?: ?{ readonly [ variable : string ] : mixed , ... } ,
131+ variableValues ?: ?{ readonly [ variable : string ] : unknown , ... } ,
132132 operationName ?: ?string ,
133133 fieldResolver ?: ?GraphQLFieldResolver < any , any > ,
134134 typeResolver ?: ?GraphQLTypeResolver < any , any > ,
@@ -210,7 +210,7 @@ export function executeSync(args: ExecutionArgs): ExecutionResult {
210210 */
211211function buildResponse (
212212 exeContext : ExecutionContext ,
213- data : PromiseOrValue < ObjMap < mixed > | null > ,
213+ data : PromiseOrValue < ObjMap < unknown > | null > ,
214214) : PromiseOrValue < ExecutionResult > {
215215 if ( isPromise ( data ) ) {
216216 return data . then ( ( resolved ) => buildResponse ( exeContext , resolved ) ) ;
@@ -229,7 +229,7 @@ function buildResponse(
229229export function assertValidExecutionArguments (
230230 schema : GraphQLSchema ,
231231 document : DocumentNode ,
232- rawVariableValues : ?{ readonly [ variable : string ] : mixed , ... } ,
232+ rawVariableValues : ?{ readonly [ variable : string ] : unknown , ... } ,
233233) : void {
234234 devAssert ( document , 'Must provide document.' ) ;
235235
@@ -254,12 +254,12 @@ export function assertValidExecutionArguments(
254254export function buildExecutionContext (
255255 schema : GraphQLSchema ,
256256 document : DocumentNode ,
257- rootValue : mixed ,
258- contextValue : mixed ,
259- rawVariableValues : ?{ readonly [ variable : string ] : mixed , ... } ,
257+ rootValue : unknown ,
258+ contextValue : unknown ,
259+ rawVariableValues : ?{ readonly [ variable : string ] : unknown , ... } ,
260260 operationName : ?string ,
261- fieldResolver : ?GraphQLFieldResolver < mixed , mixed > ,
262- typeResolver ?: ?GraphQLTypeResolver < mixed , mixed > ,
261+ fieldResolver : ?GraphQLFieldResolver < unknown , unknown > ,
262+ typeResolver ?: ?GraphQLTypeResolver < unknown , unknown > ,
263263) : ReadonlyArray < GraphQLError > | ExecutionContext {
264264 let operation : OperationDefinitionNode | void ;
265265 const fragments : ObjMap < FragmentDefinitionNode > = Object . create ( null ) ;
@@ -325,8 +325,8 @@ export function buildExecutionContext(
325325function executeOperation (
326326 exeContext : ExecutionContext ,
327327 operation : OperationDefinitionNode ,
328- rootValue : mixed ,
329- ) : PromiseOrValue < ObjMap < mixed > | null > {
328+ rootValue : unknown ,
329+ ) : PromiseOrValue < ObjMap < unknown > | null > {
330330 const type = getOperationRootType ( exeContext . schema , operation ) ;
331331 const fields = collectFields (
332332 exeContext ,
@@ -366,10 +366,10 @@ function executeOperation(
366366function executeFieldsSerially (
367367 exeContext : ExecutionContext ,
368368 parentType : GraphQLObjectType ,
369- sourceValue : mixed ,
369+ sourceValue : unknown ,
370370 path : Path | void ,
371371 fields : ObjMap < Array < FieldNode > > ,
372- ) : PromiseOrValue < ObjMap < mixed > > {
372+ ) : PromiseOrValue < ObjMap < unknown > > {
373373 return promiseReduce (
374374 Object . keys ( fields ) ,
375375 ( results , responseName ) => {
@@ -405,10 +405,10 @@ function executeFieldsSerially(
405405function executeFields (
406406 exeContext : ExecutionContext ,
407407 parentType : GraphQLObjectType ,
408- sourceValue : mixed ,
408+ sourceValue : unknown ,
409409 path : Path | void ,
410410 fields : ObjMap < Array < FieldNode > > ,
411- ) : PromiseOrValue < ObjMap < mixed > > {
411+ ) : PromiseOrValue < ObjMap < unknown > > {
412412 const results = Object . create ( null ) ;
413413 let containsPromise = false ;
414414
@@ -584,10 +584,10 @@ function getFieldEntryKey(node: FieldNode): string {
584584function resolveField (
585585 exeContext : ExecutionContext ,
586586 parentType : GraphQLObjectType ,
587- source : mixed ,
587+ source : unknown ,
588588 fieldNodes : ReadonlyArray < FieldNode > ,
589589 path : Path ,
590- ) : PromiseOrValue < mixed > {
590+ ) : PromiseOrValue < unknown > {
591591 const fieldNode = fieldNodes [ 0 ] ;
592592 const fieldName = fieldNode . name . value ;
593593
@@ -661,7 +661,7 @@ function resolveField(
661661 */
662662export function buildResolveInfo (
663663 exeContext : ExecutionContext ,
664- fieldDef : GraphQLField < mixed , mixed > ,
664+ fieldDef : GraphQLField < unknown , unknown > ,
665665 fieldNodes : ReadonlyArray < FieldNode > ,
666666 parentType : GraphQLObjectType ,
667667 path : Path ,
@@ -726,8 +726,8 @@ function completeValue(
726726 fieldNodes : ReadonlyArray < FieldNode > ,
727727 info : GraphQLResolveInfo ,
728728 path : Path ,
729- result : mixed ,
730- ) : PromiseOrValue < mixed > {
729+ result : unknown ,
730+ ) : PromiseOrValue < unknown > {
731731 // If result is an Error, throw a located error.
732732 if ( result instanceof Error ) {
733733 throw result ;
@@ -819,8 +819,8 @@ function completeListValue(
819819 fieldNodes : ReadonlyArray < FieldNode > ,
820820 info : GraphQLResolveInfo ,
821821 path : Path ,
822- result : mixed ,
823- ) : PromiseOrValue < ReadonlyArray < mixed > > {
822+ result : unknown ,
823+ ) : PromiseOrValue < ReadonlyArray < unknown > > {
824824 if ( ! isCollection ( result ) ) {
825825 throw new GraphQLError (
826826 `Expected Iterable, but did not find one for field "${ info . parentType . name } .${ info . fieldName } ".` ,
@@ -886,7 +886,7 @@ function completeListValue(
886886 * Complete a Scalar or Enum by serializing to a valid value, returning
887887 * null if serialization is not possible.
888888 */
889- function completeLeafValue ( returnType : GraphQLLeafType , result : mixed ) : mixed {
889+ function completeLeafValue ( returnType : GraphQLLeafType , result : unknown ) : unknown {
890890 const serializedResult = returnType . serialize ( result ) ;
891891 if ( serializedResult === undefined ) {
892892 throw new Error (
@@ -907,8 +907,8 @@ function completeAbstractValue(
907907 fieldNodes : ReadonlyArray < FieldNode > ,
908908 info : GraphQLResolveInfo ,
909909 path : Path ,
910- result : mixed ,
911- ) : PromiseOrValue < ObjMap < mixed > > {
910+ result : unknown ,
911+ ) : PromiseOrValue < ObjMap < unknown > > {
912912 const resolveTypeFn = returnType . resolveType ?? exeContext . typeResolver ;
913913 const contextValue = exeContext . contextValue ;
914914 const runtimeType = resolveTypeFn ( result , contextValue , info , returnType ) ;
@@ -951,12 +951,12 @@ function completeAbstractValue(
951951}
952952
953953function ensureValidRuntimeType (
954- runtimeTypeName : mixed ,
954+ runtimeTypeName : unknown ,
955955 exeContext : ExecutionContext ,
956956 returnType : GraphQLAbstractType ,
957957 fieldNodes : ReadonlyArray < FieldNode > ,
958958 info : GraphQLResolveInfo ,
959- result : mixed ,
959+ result : unknown ,
960960) : GraphQLObjectType {
961961 if ( runtimeTypeName == null ) {
962962 throw new GraphQLError (
@@ -1014,8 +1014,8 @@ function completeObjectValue(
10141014 fieldNodes : ReadonlyArray < FieldNode > ,
10151015 info : GraphQLResolveInfo ,
10161016 path : Path ,
1017- result : mixed ,
1018- ) : PromiseOrValue < ObjMap < mixed > > {
1017+ result : unknown ,
1018+ ) : PromiseOrValue < ObjMap < unknown > > {
10191019 // If there is an isTypeOf predicate function, call it with the
10201020 // current result. If isTypeOf returns false, then raise an error rather
10211021 // than continuing execution.
@@ -1053,7 +1053,7 @@ function completeObjectValue(
10531053
10541054function invalidReturnTypeError (
10551055 returnType : GraphQLObjectType ,
1056- result : mixed ,
1056+ result : unknown ,
10571057 fieldNodes : ReadonlyArray < FieldNode > ,
10581058) : GraphQLError {
10591059 return new GraphQLError (
@@ -1067,8 +1067,8 @@ function collectAndExecuteSubfields(
10671067 returnType : GraphQLObjectType ,
10681068 fieldNodes : ReadonlyArray < FieldNode > ,
10691069 path : Path ,
1070- result : mixed ,
1071- ) : PromiseOrValue < ObjMap < mixed > > {
1070+ result : unknown ,
1071+ ) : PromiseOrValue < ObjMap < unknown > > {
10721072 // Collect sub-fields to execute to complete this value.
10731073 const subFieldNodes = collectSubfields ( exeContext , returnType , fieldNodes ) ;
10741074 return executeFields ( exeContext , returnType , result , path , subFieldNodes ) ;
@@ -1111,7 +1111,7 @@ function _collectSubfields(
11111111 * Otherwise, test each possible type for the abstract type by calling
11121112 * isTypeOf for the object being coerced, returning the first type that matches.
11131113 */
1114- export const defaultTypeResolver : GraphQLTypeResolver < mixed , mixed > = function (
1114+ export const defaultTypeResolver : GraphQLTypeResolver < unknown , unknown > = function (
11151115 value ,
11161116 contextValue ,
11171117 info ,
@@ -1158,8 +1158,8 @@ export const defaultTypeResolver: GraphQLTypeResolver<mixed, mixed> = function (
11581158 * of calling that function while passing along args and context value.
11591159 */
11601160export const defaultFieldResolver : GraphQLFieldResolver <
1161- mixed ,
1162- mixed ,
1161+ unknown ,
1162+ unknown ,
11631163> = function ( source : any , args , contextValue , info ) {
11641164 // ensure source is a value for which property access is acceptable.
11651165 if ( isObjectLike ( source ) || typeof source === 'function' ) {
@@ -1186,7 +1186,7 @@ export function getFieldDef(
11861186 schema : GraphQLSchema ,
11871187 parentType : GraphQLObjectType ,
11881188 fieldName : string ,
1189- ) : ?GraphQLField < mixed , mixed > {
1189+ ) : ?GraphQLField < unknown , unknown > {
11901190 if (
11911191 fieldName === SchemaMetaFieldDef . name &&
11921192 schema . getQueryType ( ) === parentType
0 commit comments