From 673cb95835185377b89fc6f9506941f53bdfe049 Mon Sep 17 00:00:00 2001 From: Saihajpreet Singh Date: Tue, 30 Mar 2021 13:29:34 -0500 Subject: [PATCH] TS: use `unknown` (TS) for `mixed` (flow) (#3003) --- src/error/GraphQLError.d.ts | 4 +- src/error/formatError.d.ts | 2 +- src/error/locatedError.d.ts | 2 +- src/execution/execute.d.ts | 32 ++++---- src/execution/values.d.ts | 14 ++-- src/graphql.d.ts | 6 +- src/language/ast.d.ts | 2 +- src/language/source.d.ts | 2 +- src/subscription/subscribe.d.ts | 14 ++-- src/type/definition.d.ts | 108 +++++++++++++------------ src/type/directives.d.ts | 4 +- src/type/introspection.d.ts | 6 +- src/type/schema.d.ts | 4 +- src/utilities/TypeInfo.d.ts | 6 +- src/utilities/astFromValue.d.ts | 2 +- src/utilities/coerceInputValue.d.ts | 6 +- src/utilities/valueFromAST.d.ts | 4 +- src/utilities/valueFromASTUntyped.d.ts | 4 +- src/validation/ValidationContext.d.ts | 4 +- 19 files changed, 114 insertions(+), 112 deletions(-) diff --git a/src/error/GraphQLError.d.ts b/src/error/GraphQLError.d.ts index 99001fd26f..e5b754b21b 100644 --- a/src/error/GraphQLError.d.ts +++ b/src/error/GraphQLError.d.ts @@ -18,7 +18,7 @@ export class GraphQLError extends Error { positions?: Maybe>, path?: Maybe>, originalError?: Maybe, - extensions?: Maybe<{ [key: string]: any }>, + extensions?: Maybe<{ [key: string]: unknown }>, ); /** @@ -77,7 +77,7 @@ export class GraphQLError extends Error { /** * Extension fields to add to the formatted error. */ - readonly extensions: { [key: string]: any } | undefined; + readonly extensions: { [key: string]: unknown } | undefined; } /** diff --git a/src/error/formatError.d.ts b/src/error/formatError.d.ts index fb3451b774..1fdea0c355 100644 --- a/src/error/formatError.d.ts +++ b/src/error/formatError.d.ts @@ -12,7 +12,7 @@ export function formatError(error: GraphQLError): GraphQLFormattedError; * @see https://github.com/graphql/graphql-spec/blob/master/spec/Section%207%20--%20Response.md#errors */ export interface GraphQLFormattedError< - TExtensions extends Record = Record + TExtensions extends Record = Record > { /** * A short, human-readable summary of the problem that **SHOULD NOT** change diff --git a/src/error/locatedError.d.ts b/src/error/locatedError.d.ts index 8693757094..696a1338ba 100644 --- a/src/error/locatedError.d.ts +++ b/src/error/locatedError.d.ts @@ -10,7 +10,7 @@ import { GraphQLError } from './GraphQLError'; * document responsible for the original Error. */ export function locatedError( - rawOriginalError: any, + rawOriginalError: unknown, nodes: ASTNode | ReadonlyArray | undefined, path?: Maybe>, ): GraphQLError; diff --git a/src/execution/execute.d.ts b/src/execution/execute.d.ts index ebaea15882..572c412e3a 100644 --- a/src/execution/execute.d.ts +++ b/src/execution/execute.d.ts @@ -51,10 +51,10 @@ import { export interface ExecutionContext { schema: GraphQLSchema; fragments: { [key: string]: FragmentDefinitionNode }; - rootValue: any; - contextValue: any; + rootValue: unknown; + contextValue: unknown; operation: OperationDefinitionNode; - variableValues: { [key: string]: any }; + variableValues: { [key: string]: unknown }; fieldResolver: GraphQLFieldResolver; typeResolver: GraphQLTypeResolver; errors: Array; @@ -90,9 +90,9 @@ export interface FormattedExecutionResult< export interface ExecutionArgs { schema: GraphQLSchema; document: DocumentNode; - rootValue?: any; - contextValue?: any; - variableValues?: Maybe<{ [key: string]: any }>; + rootValue?: unknown; + contextValue?: unknown; + variableValues?: Maybe<{ [key: string]: unknown }>; operationName?: Maybe; fieldResolver?: Maybe>; typeResolver?: Maybe>; @@ -126,7 +126,7 @@ export function executeSync(args: ExecutionArgs): ExecutionResult; export function assertValidExecutionArguments( schema: GraphQLSchema, document: DocumentNode, - rawVariableValues: Maybe<{ [key: string]: any }>, + rawVariableValues: Maybe<{ [key: string]: unknown }>, ): void; /** @@ -140,12 +140,12 @@ export function assertValidExecutionArguments( export function buildExecutionContext( schema: GraphQLSchema, document: DocumentNode, - rootValue: any, - contextValue: any, - rawVariableValues: Maybe<{ [key: string]: any }>, + rootValue: unknown, + contextValue: unknown, + rawVariableValues: Maybe<{ [key: string]: unknown }>, operationName: Maybe, - fieldResolver: Maybe>, - typeResolver?: Maybe>, + fieldResolver: Maybe>, + typeResolver?: Maybe>, ): ReadonlyArray | ExecutionContext; /** @@ -171,7 +171,7 @@ export function collectFields( */ export function buildResolveInfo( exeContext: ExecutionContext, - fieldDef: GraphQLField, + fieldDef: GraphQLField, fieldNodes: ReadonlyArray, parentType: GraphQLObjectType, path: Path, @@ -187,7 +187,7 @@ export function buildResolveInfo( * 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; +export const defaultTypeResolver: GraphQLTypeResolver; /** * If a resolve function is not given, then a default resolve behavior is used @@ -195,7 +195,7 @@ export const defaultTypeResolver: GraphQLTypeResolver; * 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; +export const defaultFieldResolver: GraphQLFieldResolver; /** * This method looks up the field on the given type definition. @@ -212,4 +212,4 @@ export function getFieldDef( schema: GraphQLSchema, parentType: GraphQLObjectType, fieldName: string, -): Maybe>; +): Maybe>; diff --git a/src/execution/values.d.ts b/src/execution/values.d.ts index 8b17b5487a..b2a01dbee5 100644 --- a/src/execution/values.d.ts +++ b/src/execution/values.d.ts @@ -13,7 +13,7 @@ import { GraphQLField } from '../type/definition'; type CoercedVariableValues = | { errors: ReadonlyArray; coerced?: never } - | { errors?: never; coerced: { [key: string]: any } }; + | { errors?: never; coerced: { [key: string]: unknown } }; /** * Prepares an object map of variableValues of the correct type based on the @@ -27,7 +27,7 @@ type CoercedVariableValues = export function getVariableValues( schema: GraphQLSchema, varDefNodes: ReadonlyArray, - inputs: { [key: string]: any }, + inputs: { [key: string]: unknown }, options?: { maxErrors?: number }, ): CoercedVariableValues; @@ -40,10 +40,10 @@ export function getVariableValues( * Object prototype. */ export function getArgumentValues( - def: GraphQLField | GraphQLDirective, + def: GraphQLField | GraphQLDirective, node: FieldNode | DirectiveNode, - variableValues?: Maybe<{ [key: string]: any }>, -): { [key: string]: any }; + variableValues?: Maybe<{ [key: string]: unknown }>, +): { [key: string]: unknown }; /** * Prepares an object map of argument values given a directive definition @@ -61,5 +61,5 @@ export function getDirectiveValues( node: { readonly directives?: ReadonlyArray; }, - variableValues?: Maybe<{ [key: string]: any }>, -): undefined | { [key: string]: any }; + variableValues?: Maybe<{ [key: string]: unknown }>, +): undefined | { [key: string]: unknown }; diff --git a/src/graphql.d.ts b/src/graphql.d.ts index 2d6d15a5c4..94b31bb414 100644 --- a/src/graphql.d.ts +++ b/src/graphql.d.ts @@ -47,9 +47,9 @@ import { ExecutionResult } from './execution/execute'; export interface GraphQLArgs { schema: GraphQLSchema; source: string | Source; - rootValue?: any; - contextValue?: any; - variableValues?: Maybe<{ [key: string]: any }>; + rootValue?: unknown; + contextValue?: unknown; + variableValues?: Maybe<{ [key: string]: unknown }>; operationName?: Maybe; fieldResolver?: Maybe>; typeResolver?: Maybe>; diff --git a/src/language/ast.d.ts b/src/language/ast.d.ts index 693657d642..20ec92f805 100644 --- a/src/language/ast.d.ts +++ b/src/language/ast.d.ts @@ -100,7 +100,7 @@ export class Token { /** * @internal */ -export function isNode(maybeNode: any): maybeNode is ASTNode; +export function isNode(maybeNode: unknown): maybeNode is ASTNode; /** * The list of all possible AST node types. diff --git a/src/language/source.d.ts b/src/language/source.d.ts index c216fa9233..a9e8c7dacc 100644 --- a/src/language/source.d.ts +++ b/src/language/source.d.ts @@ -23,4 +23,4 @@ export class Source { * * @internal */ -export function isSource(source: any): source is Source; +export function isSource(source: unknown): source is Source; diff --git a/src/subscription/subscribe.d.ts b/src/subscription/subscribe.d.ts index ff2ed138c4..2dcfeed21e 100644 --- a/src/subscription/subscribe.d.ts +++ b/src/subscription/subscribe.d.ts @@ -8,9 +8,9 @@ import { GraphQLFieldResolver } from '../type/definition'; export interface SubscriptionArgs { schema: GraphQLSchema; document: DocumentNode; - rootValue?: any; - contextValue?: any; - variableValues?: Maybe>; + rootValue?: unknown; + contextValue?: unknown; + variableValues?: Maybe>; operationName?: Maybe; fieldResolver?: Maybe>; subscribeFieldResolver?: Maybe>; @@ -72,9 +72,9 @@ export function subscribe( export function createSourceEventStream( schema: GraphQLSchema, document: DocumentNode, - rootValue?: any, - contextValue?: any, - variableValues?: { [key: string]: any }, + rootValue?: unknown, + contextValue?: unknown, + variableValues?: { [key: string]: unknown }, operationName?: Maybe, fieldResolver?: Maybe>, -): Promise | ExecutionResult>; +): Promise | ExecutionResult>; diff --git a/src/type/definition.d.ts b/src/type/definition.d.ts index ee73b426ae..d47eadd138 100644 --- a/src/type/definition.d.ts +++ b/src/type/definition.d.ts @@ -44,41 +44,43 @@ export type GraphQLType = | GraphQLList | GraphQLNonNull; -export function isType(type: any): type is GraphQLType; +export function isType(type: unknown): type is GraphQLType; -export function assertType(type: any): GraphQLType; +export function assertType(type: unknown): GraphQLType; -export function isScalarType(type: any): type is GraphQLScalarType; +export function isScalarType(type: unknown): type is GraphQLScalarType; -export function assertScalarType(type: any): GraphQLScalarType; +export function assertScalarType(type: unknown): GraphQLScalarType; -export function isObjectType(type: any): type is GraphQLObjectType; +export function isObjectType(type: unknown): type is GraphQLObjectType; -export function assertObjectType(type: any): GraphQLObjectType; +export function assertObjectType(type: unknown): GraphQLObjectType; -export function isInterfaceType(type: any): type is GraphQLInterfaceType; +export function isInterfaceType(type: unknown): type is GraphQLInterfaceType; -export function assertInterfaceType(type: any): GraphQLInterfaceType; +export function assertInterfaceType(type: unknown): GraphQLInterfaceType; -export function isUnionType(type: any): type is GraphQLUnionType; +export function isUnionType(type: unknown): type is GraphQLUnionType; -export function assertUnionType(type: any): GraphQLUnionType; +export function assertUnionType(type: unknown): GraphQLUnionType; -export function isEnumType(type: any): type is GraphQLEnumType; +export function isEnumType(type: unknown): type is GraphQLEnumType; -export function assertEnumType(type: any): GraphQLEnumType; +export function assertEnumType(type: unknown): GraphQLEnumType; -export function isInputObjectType(type: any): type is GraphQLInputObjectType; +export function isInputObjectType( + type: unknown, +): type is GraphQLInputObjectType; -export function assertInputObjectType(type: any): GraphQLInputObjectType; +export function assertInputObjectType(type: unknown): GraphQLInputObjectType; -export function isListType(type: any): type is GraphQLList; +export function isListType(type: unknown): type is GraphQLList; -export function assertListType(type: any): GraphQLList; +export function assertListType(type: unknown): GraphQLList; -export function isNonNullType(type: any): type is GraphQLNonNull; +export function isNonNullType(type: unknown): type is GraphQLNonNull; -export function assertNonNullType(type: any): GraphQLNonNull; +export function assertNonNullType(type: unknown): GraphQLNonNull; /** * These types may be used as input types for arguments and directives. @@ -96,9 +98,9 @@ export type GraphQLInputType = | GraphQLList >; -export function isInputType(type: any): type is GraphQLInputType; +export function isInputType(type: unknown): type is GraphQLInputType; -export function assertInputType(type: any): GraphQLInputType; +export function assertInputType(type: unknown): GraphQLInputType; /** * These types may be used as output types as the result of fields. @@ -129,9 +131,9 @@ export function assertOutputType(type: any): GraphQLOutputType; */ export type GraphQLLeafType = GraphQLScalarType | GraphQLEnumType; -export function isLeafType(type: any): type is GraphQLLeafType; +export function isLeafType(type: unknown): type is GraphQLLeafType; -export function assertLeafType(type: any): GraphQLLeafType; +export function assertLeafType(type: unknown): GraphQLLeafType; /** * These types may describe the parent context of a selection set. @@ -141,18 +143,18 @@ export type GraphQLCompositeType = | GraphQLInterfaceType | GraphQLUnionType; -export function isCompositeType(type: any): type is GraphQLCompositeType; +export function isCompositeType(type: unknown): type is GraphQLCompositeType; -export function assertCompositeType(type: any): GraphQLCompositeType; +export function assertCompositeType(type: unknown): GraphQLCompositeType; /** * These types may describe the parent context of a selection set. */ export type GraphQLAbstractType = GraphQLInterfaceType | GraphQLUnionType; -export function isAbstractType(type: any): type is GraphQLAbstractType; +export function isAbstractType(type: unknown): type is GraphQLAbstractType; -export function assertAbstractType(type: any): GraphQLAbstractType; +export function assertAbstractType(type: unknown): GraphQLAbstractType; /** * List Modifier @@ -216,9 +218,9 @@ export class GraphQLNonNull { export type GraphQLWrappingType = GraphQLList | GraphQLNonNull; -export function isWrappingType(type: any): type is GraphQLWrappingType; +export function isWrappingType(type: unknown): type is GraphQLWrappingType; -export function assertWrappingType(type: any): GraphQLWrappingType; +export function assertWrappingType(type: unknown): GraphQLWrappingType; /** * These types can all accept null as a value. @@ -232,9 +234,9 @@ export type GraphQLNullableType = | GraphQLInputObjectType | GraphQLList; -export function isNullableType(type: any): type is GraphQLNullableType; +export function isNullableType(type: unknown): type is GraphQLNullableType; -export function assertNullableType(type: any): GraphQLNullableType; +export function assertNullableType(type: unknown): GraphQLNullableType; export function getNullableType(type: undefined): undefined; export function getNullableType(type: T): T; @@ -255,9 +257,9 @@ export type GraphQLNamedType = | GraphQLEnumType | GraphQLInputObjectType; -export function isNamedType(type: any): type is GraphQLNamedType; +export function isNamedType(type: unknown): type is GraphQLNamedType; -export function assertNamedType(type: any): GraphQLNamedType; +export function assertNamedType(type: unknown): GraphQLNamedType; export function getNamedType(type: undefined): undefined; export function getNamedType(type: GraphQLType): GraphQLNamedType; @@ -303,20 +305,20 @@ export class GraphQLScalarType { name: string; description: Maybe; specifiedByUrl: Maybe; - serialize: GraphQLScalarSerializer; - parseValue: GraphQLScalarValueParser; - parseLiteral: GraphQLScalarLiteralParser; + serialize: GraphQLScalarSerializer; + parseValue: GraphQLScalarValueParser; + parseLiteral: GraphQLScalarLiteralParser; extensions: Maybe>; astNode: Maybe; extensionASTNodes: ReadonlyArray; - constructor(config: Readonly>); + constructor(config: Readonly>); - toConfig(): GraphQLScalarTypeConfig & { + toConfig(): GraphQLScalarTypeConfig & { specifiedByUrl: Maybe; - serialize: GraphQLScalarSerializer; - parseValue: GraphQLScalarValueParser; - parseLiteral: GraphQLScalarLiteralParser; + serialize: GraphQLScalarSerializer; + parseValue: GraphQLScalarValueParser; + parseLiteral: GraphQLScalarLiteralParser; extensions: Maybe>; extensionASTNodes: ReadonlyArray; }; @@ -327,14 +329,14 @@ export class GraphQLScalarType { } export type GraphQLScalarSerializer = ( - value: any, + value: unknown, ) => Maybe; export type GraphQLScalarValueParser = ( - value: any, + value: unknown, ) => Maybe; export type GraphQLScalarLiteralParser = ( valueNode: ValueNode, - variables: Maybe<{ [key: string]: any }>, + variables: Maybe<{ [key: string]: unknown }>, ) => Maybe; export interface GraphQLScalarTypeConfig { @@ -468,7 +470,7 @@ export type GraphQLFieldResolver< args: TArgs, context: TContext, info: GraphQLResolveInfo, -) => any; +) => unknown; export interface GraphQLResolveInfo { readonly fieldName: string; @@ -478,9 +480,9 @@ export interface GraphQLResolveInfo { readonly path: Path; readonly schema: GraphQLSchema; readonly fragments: { [key: string]: FragmentDefinitionNode }; - readonly rootValue: any; + readonly rootValue: unknown; readonly operation: OperationDefinitionNode; - readonly variableValues: { [variableName: string]: any }; + readonly variableValues: { [variableName: string]: unknown }; } /** @@ -540,7 +542,7 @@ export interface GraphQLArgumentExtensions { export interface GraphQLArgumentConfig { description?: Maybe; type: GraphQLInputType; - defaultValue?: any; + defaultValue?: unknown; deprecationReason?: Maybe; extensions?: Maybe>; astNode?: Maybe; @@ -570,7 +572,7 @@ export interface GraphQLArgument { name: string; description: Maybe; type: GraphQLInputType; - defaultValue: any; + defaultValue: unknown; deprecationReason: Maybe; extensions: Maybe>; astNode: Maybe; @@ -772,11 +774,11 @@ export class GraphQLEnumType { constructor(config: Readonly); getValues(): Array; getValue(name: string): Maybe; - serialize(value: any): Maybe; - parseValue(value: any): Maybe; + serialize(value: unknown): Maybe; + parseValue(value: unknown): Maybe; parseLiteral( valueNode: ValueNode, - _variables: Maybe<{ [key: string]: any }>, + _variables: Maybe<{ [key: string]: unknown }>, ): Maybe; toConfig(): GraphQLEnumTypeConfig & { @@ -913,7 +915,7 @@ export interface GraphQLInputFieldExtensions { export interface GraphQLInputFieldConfig { description?: Maybe; type: GraphQLInputType; - defaultValue?: any; + defaultValue?: unknown; deprecationReason?: Maybe; extensions?: Maybe>; astNode?: Maybe; @@ -927,7 +929,7 @@ export interface GraphQLInputField { name: string; description?: Maybe; type: GraphQLInputType; - defaultValue?: any; + defaultValue?: unknown; deprecationReason: Maybe; extensions: Maybe>; astNode?: Maybe; diff --git a/src/type/directives.d.ts b/src/type/directives.d.ts index 1feae76aa8..24fa2d6212 100644 --- a/src/type/directives.d.ts +++ b/src/type/directives.d.ts @@ -11,8 +11,8 @@ import { GraphQLFieldConfigArgumentMap, GraphQLArgument } from './definition'; /** * Test if the given value is a GraphQL directive. */ -export function isDirective(directive: any): directive is GraphQLDirective; -export function assertDirective(directive: any): GraphQLDirective; +export function isDirective(directive: unknown): directive is GraphQLDirective; +export function assertDirective(directive: unknown): GraphQLDirective; /** * Custom extensions diff --git a/src/type/introspection.d.ts b/src/type/introspection.d.ts index fc1512f795..54c55e1d9e 100644 --- a/src/type/introspection.d.ts +++ b/src/type/introspection.d.ts @@ -31,9 +31,9 @@ export const __TypeKind: GraphQLEnumType; * so the format for args is different. */ -export const SchemaMetaFieldDef: GraphQLField; -export const TypeMetaFieldDef: GraphQLField; -export const TypeNameMetaFieldDef: GraphQLField; +export const SchemaMetaFieldDef: GraphQLField; +export const TypeMetaFieldDef: GraphQLField; +export const TypeNameMetaFieldDef: GraphQLField; export const introspectionTypes: ReadonlyArray; diff --git a/src/type/schema.d.ts b/src/type/schema.d.ts index 58d8f5e09a..f28e6b0847 100644 --- a/src/type/schema.d.ts +++ b/src/type/schema.d.ts @@ -16,8 +16,8 @@ import { /** * Test if the given value is a GraphQL schema. */ -export function isSchema(schema: any): schema is GraphQLSchema; -export function assertSchema(schema: any): GraphQLSchema; +export function isSchema(schema: unknown): schema is GraphQLSchema; +export function assertSchema(schema: unknown): GraphQLSchema; /** * Custom extensions diff --git a/src/utilities/TypeInfo.d.ts b/src/utilities/TypeInfo.d.ts index f2448ba33a..cb73737390 100644 --- a/src/utilities/TypeInfo.d.ts +++ b/src/utilities/TypeInfo.d.ts @@ -34,8 +34,8 @@ export class TypeInfo { getParentType(): Maybe; getInputType(): Maybe; getParentInputType(): Maybe; - getFieldDef(): Maybe>; - getDefaultValue(): Maybe; + getFieldDef(): Maybe>; + getDefaultValue(): Maybe; getDirective(): Maybe; getArgument(): Maybe; getEnumValue(): Maybe; @@ -47,7 +47,7 @@ type getFieldDef = ( schema: GraphQLSchema, parentType: GraphQLType, fieldNode: FieldNode, -) => Maybe>; +) => Maybe>; /** * Creates a new visitor instance which maintains a provided TypeInfo instance diff --git a/src/utilities/astFromValue.d.ts b/src/utilities/astFromValue.d.ts index 19f0a8feed..5750a50ef1 100644 --- a/src/utilities/astFromValue.d.ts +++ b/src/utilities/astFromValue.d.ts @@ -21,6 +21,6 @@ import { GraphQLInputType } from '../type/definition'; * */ export function astFromValue( - value: any, + value: unknown, type: GraphQLInputType, ): Maybe; diff --git a/src/utilities/coerceInputValue.d.ts b/src/utilities/coerceInputValue.d.ts index 45c70a5d33..78dafb257f 100644 --- a/src/utilities/coerceInputValue.d.ts +++ b/src/utilities/coerceInputValue.d.ts @@ -3,7 +3,7 @@ import { GraphQLError } from '../error/GraphQLError'; type OnErrorCB = ( path: ReadonlyArray, - invalidValue: any, + invalidValue: unknown, error: GraphQLError, ) => void; @@ -11,7 +11,7 @@ type OnErrorCB = ( * Coerces a JavaScript value given a GraphQL Input Type. */ export function coerceInputValue( - inputValue: any, + inputValue: unknown, type: GraphQLInputType, onError?: OnErrorCB, -): any; +): unknown; diff --git a/src/utilities/valueFromAST.d.ts b/src/utilities/valueFromAST.d.ts index acde6ba9df..2e5cefd604 100644 --- a/src/utilities/valueFromAST.d.ts +++ b/src/utilities/valueFromAST.d.ts @@ -26,5 +26,5 @@ import { GraphQLInputType } from '../type/definition'; export function valueFromAST( valueNode: Maybe, type: GraphQLInputType, - variables?: Maybe<{ [key: string]: any }>, -): any; + variables?: Maybe<{ [key: string]: unknown }>, +): unknown; diff --git a/src/utilities/valueFromASTUntyped.d.ts b/src/utilities/valueFromASTUntyped.d.ts index a44959da6a..b1c4e5d4b4 100644 --- a/src/utilities/valueFromASTUntyped.d.ts +++ b/src/utilities/valueFromASTUntyped.d.ts @@ -20,5 +20,5 @@ import { ValueNode } from '../language/ast'; */ export function valueFromASTUntyped( valueNode: ValueNode, - variables?: Maybe<{ [key: string]: any }>, -): any; + variables?: Maybe<{ [key: string]: unknown }>, +): unknown; diff --git a/src/validation/ValidationContext.d.ts b/src/validation/ValidationContext.d.ts index e0ca546b0e..a09b42bcb7 100644 --- a/src/validation/ValidationContext.d.ts +++ b/src/validation/ValidationContext.d.ts @@ -26,7 +26,7 @@ type NodeWithSelectionSet = OperationDefinitionNode | FragmentDefinitionNode; interface VariableUsage { readonly node: VariableNode; readonly type: Maybe; - readonly defaultValue: Maybe; + readonly defaultValue: Maybe; } /** @@ -86,7 +86,7 @@ export class ValidationContext extends ASTValidationContext { getParentInputType(): Maybe; - getFieldDef(): Maybe>; + getFieldDef(): Maybe>; getDirective(): Maybe;