From 0375b8cb0e99206898e9539c05803b7b430f4182 Mon Sep 17 00:00:00 2001 From: Dylan Owen Date: Thu, 16 Mar 2023 12:13:19 -0400 Subject: [PATCH] Narrow the return type of astFromValue --- src/utilities/astFromValue.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/utilities/astFromValue.ts b/src/utilities/astFromValue.ts index e1d994a8ee..bb03baf232 100644 --- a/src/utilities/astFromValue.ts +++ b/src/utilities/astFromValue.ts @@ -4,7 +4,7 @@ import { isIterableObject } from '../jsutils/isIterableObject.js'; import { isObjectLike } from '../jsutils/isObjectLike.js'; import type { Maybe } from '../jsutils/Maybe.js'; -import type { ObjectFieldNode, ValueNode } from '../language/ast.js'; +import type { ConstObjectFieldNode, ConstValueNode } from '../language/ast.js'; import { Kind } from '../language/kinds.js'; import type { GraphQLInputType } from '../type/definition.js'; @@ -41,7 +41,7 @@ import { GraphQLID } from '../type/scalars.js'; export function astFromValue( value: unknown, type: GraphQLInputType, -): Maybe { +): Maybe { if (isNonNullType(type)) { const astValue = astFromValue(value, type.ofType); if (astValue?.kind === Kind.NULL) { @@ -83,7 +83,7 @@ export function astFromValue( if (!isObjectLike(value)) { return null; } - const fieldNodes: Array = []; + const fieldNodes: Array = []; for (const field of Object.values(type.getFields())) { const fieldValue = astFromValue(value[field.name], field.type); if (fieldValue) {