From cf2ce5ed4773087cc324599f2812f4fb91398b21 Mon Sep 17 00:00:00 2001 From: Alexander Kachkaev Date: Tue, 15 Oct 2024 12:07:35 +0200 Subject: [PATCH] Make two types compatible with strict tsc config (#6524) * Make two types compatible compatible with strict tsc config * Add changeset * `yarn prettier` --- .changeset/wise-parrots-walk.md | 5 +++++ packages/utils/src/getDirectiveExtensions.ts | 11 +++++++---- 2 files changed, 12 insertions(+), 4 deletions(-) create mode 100644 .changeset/wise-parrots-walk.md diff --git a/.changeset/wise-parrots-walk.md b/.changeset/wise-parrots-walk.md new file mode 100644 index 00000000000..483316cb858 --- /dev/null +++ b/.changeset/wise-parrots-walk.md @@ -0,0 +1,5 @@ +--- +'@graphql-tools/utils': patch +--- + +Make two types compatible with strict tsc config diff --git a/packages/utils/src/getDirectiveExtensions.ts b/packages/utils/src/getDirectiveExtensions.ts index d0e82269a0d..81c91673970 100644 --- a/packages/utils/src/getDirectiveExtensions.ts +++ b/packages/utils/src/getDirectiveExtensions.ts @@ -3,11 +3,14 @@ import { valueFromAST, valueFromASTUntyped } from 'graphql'; import { getArgumentValues } from './getArgumentValues.js'; import { memoize1 } from './memoize.js'; -export type DirectableASTNode = ASTNode & { directives?: readonly DirectiveNode[] }; +export type DirectableASTNode = ASTNode & { + directives?: readonly DirectiveNode[] | undefined; +}; + export type DirectableObject = { - astNode?: DirectableASTNode | null; - extensionASTNodes?: readonly DirectableASTNode[] | null; - extensions?: { directives?: Record } | null; + astNode?: DirectableASTNode | null | undefined; + extensionASTNodes?: readonly DirectableASTNode[] | null | undefined; + extensions?: { directives?: Record | undefined } | null | undefined; }; export function getDirectiveExtensions<