@graphql-codegen/plugin-helpers 7.3.0 → 7.4.0-alpha-20260927031954-000584fcd017ac5ee28b5fa0291f26a21da4bdce

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@graphql-codegen/plugin-helpers",
3
- "version": "7.3.0",
3
+ "version": "7.4.0-alpha-20260927031954-000584fcd017ac5ee28b5fa0291f26a21da4bdce",
4
4
  "description": "GraphQL Code Generator common utils and types",
5
5
  "peerDependencies": {
6
6
  "graphql": "^0.8.0 || ^0.9.0 || ^0.10.0 || ^0.11.0 || ^0.12.0 || ^0.13.0 || ^14.0.0 || ^15.0.0 || ^16.0.0 || ^17.0.0"
@@ -1,2 +1,19 @@
1
- import { ASTNode } from 'graphql';
2
- export declare function oldVisit(root: ASTNode, { enter: enterVisitors, leave: leaveVisitors, ...newVisitor }: any): any;
1
+ import { ASTNode, DocumentNode } from 'graphql';
2
+ /**
3
+ * The result of `oldVisit` on a `DocumentNode` with `leave` visitors.
4
+ *
5
+ * Each definition is replaced by whatever its leave visitor returned (usually a string). Definitions
6
+ * without a leave visitor stay as AST nodes, so check each one before using it.
7
+ */
8
+ export type OldVisitDocumentResult = Omit<DocumentNode, 'definitions'> & {
9
+ definitions: unknown[];
10
+ };
11
+ /**
12
+ * Visits `root` with `enter` and `leave` visitor maps keyed by AST node kind.
13
+ *
14
+ * Leave visitors replace nodes with whatever they return, so the result's shape depends on the
15
+ * visitor. For a `DocumentNode`, it defaults to `OldVisitDocumentResult`. When a `Document` leave
16
+ * visitor returns a value of its own, pass its type as `TResult`.
17
+ */
18
+ export declare function oldVisit<TResult = OldVisitDocumentResult>(root: DocumentNode, visitor: any): TResult;
19
+ export declare function oldVisit<TResult = unknown>(root: ASTNode, visitor: any): TResult;
@@ -1,2 +1,19 @@
1
- import { ASTNode } from 'graphql';
2
- export declare function oldVisit(root: ASTNode, { enter: enterVisitors, leave: leaveVisitors, ...newVisitor }: any): any;
1
+ import { ASTNode, DocumentNode } from 'graphql';
2
+ /**
3
+ * The result of `oldVisit` on a `DocumentNode` with `leave` visitors.
4
+ *
5
+ * Each definition is replaced by whatever its leave visitor returned (usually a string). Definitions
6
+ * without a leave visitor stay as AST nodes, so check each one before using it.
7
+ */
8
+ export type OldVisitDocumentResult = Omit<DocumentNode, 'definitions'> & {
9
+ definitions: unknown[];
10
+ };
11
+ /**
12
+ * Visits `root` with `enter` and `leave` visitor maps keyed by AST node kind.
13
+ *
14
+ * Leave visitors replace nodes with whatever they return, so the result's shape depends on the
15
+ * visitor. For a `DocumentNode`, it defaults to `OldVisitDocumentResult`. When a `Document` leave
16
+ * visitor returns a value of its own, pass its type as `TResult`.
17
+ */
18
+ export declare function oldVisit<TResult = OldVisitDocumentResult>(root: DocumentNode, visitor: any): TResult;
19
+ export declare function oldVisit<TResult = unknown>(root: ASTNode, visitor: any): TResult;