Skip to content

Commit

Permalink
Make two types compatible with strict tsc config (#6524)
Browse files Browse the repository at this point in the history
* Make two types compatible compatible with strict tsc config

* Add changeset

* `yarn prettier`
  • Loading branch information
kachkaev authored Oct 15, 2024
1 parent 97c21dd commit cf2ce5e
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
5 changes: 5 additions & 0 deletions .changeset/wise-parrots-walk.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@graphql-tools/utils': patch
---

Make two types compatible with strict tsc config
11 changes: 7 additions & 4 deletions packages/utils/src/getDirectiveExtensions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<string, any> } | null;
astNode?: DirectableASTNode | null | undefined;
extensionASTNodes?: readonly DirectableASTNode[] | null | undefined;
extensions?: { directives?: Record<string, any> | undefined } | null | undefined;
};

export function getDirectiveExtensions<
Expand Down

0 comments on commit cf2ce5e

Please sign in to comment.