@graphql-mesh/utils 1.0.0-alpha-20220804093904-8e2e41f7f → 1.0.0-alpha-20230420220344-25b6b92bf

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.
Files changed (85) hide show
  1. package/cjs/apply-transforms.js +35 -0
  2. package/cjs/defaultImportFn.js +57 -0
  3. package/cjs/extract-resolvers.js +23 -0
  4. package/cjs/fileURLToPath.js +50 -0
  5. package/cjs/fs-operations.js +65 -0
  6. package/cjs/getHeadersObj.js +61 -0
  7. package/cjs/global-lru-cache.js +9 -0
  8. package/cjs/group-transforms.js +17 -0
  9. package/cjs/index.js +20 -0
  10. package/cjs/load-from-module-export-expression.js +29 -0
  11. package/cjs/logger.js +127 -0
  12. package/cjs/package.json +1 -0
  13. package/cjs/parseAndPrintWithCache.js +42 -0
  14. package/cjs/pubsub.js +57 -0
  15. package/cjs/read-file-or-url.js +132 -0
  16. package/cjs/resolve-additional-resolvers.js +350 -0
  17. package/cjs/sanitize-name-for-graphql.js +96 -0
  18. package/cjs/with-cancel.js +34 -0
  19. package/cjs/with-cookies.js +18 -0
  20. package/cjs/with-filter.js +53 -0
  21. package/esm/apply-transforms.js +29 -0
  22. package/esm/defaultImportFn.js +32 -0
  23. package/esm/extract-resolvers.js +19 -0
  24. package/esm/fileURLToPath.js +46 -0
  25. package/esm/fs-operations.js +57 -0
  26. package/esm/getHeadersObj.js +57 -0
  27. package/esm/global-lru-cache.js +4 -0
  28. package/esm/group-transforms.js +13 -0
  29. package/esm/index.js +17 -0
  30. package/esm/load-from-module-export-expression.js +25 -0
  31. package/esm/logger.js +118 -0
  32. package/esm/parseAndPrintWithCache.js +37 -0
  33. package/esm/pubsub.js +53 -0
  34. package/esm/read-file-or-url.js +124 -0
  35. package/esm/resolve-additional-resolvers.js +344 -0
  36. package/esm/sanitize-name-for-graphql.js +91 -0
  37. package/esm/with-cancel.js +30 -0
  38. package/esm/with-cookies.js +14 -0
  39. package/esm/with-filter.js +49 -0
  40. package/package.json +28 -23
  41. package/typings/apply-transforms.d.cts +6 -0
  42. package/{apply-transforms.d.ts → typings/apply-transforms.d.ts} +3 -3
  43. package/typings/defaultImportFn.d.cts +2 -0
  44. package/typings/defaultImportFn.d.ts +2 -0
  45. package/typings/extract-resolvers.d.ts +2 -0
  46. package/typings/fileURLToPath.d.ts +1 -0
  47. package/typings/fs-operations.d.ts +7 -0
  48. package/typings/getHeadersObj.d.cts +1 -0
  49. package/typings/getHeadersObj.d.ts +1 -0
  50. package/typings/global-lru-cache.d.cts +3 -0
  51. package/{global-lru-cache.d.ts → typings/global-lru-cache.d.ts} +2 -2
  52. package/typings/group-transforms.d.ts +5 -0
  53. package/typings/index.d.cts +17 -0
  54. package/typings/index.d.ts +17 -0
  55. package/typings/load-from-module-export-expression.d.cts +8 -0
  56. package/{load-from-module-export-expression.d.ts → typings/load-from-module-export-expression.d.ts} +1 -1
  57. package/typings/logger.d.cts +22 -0
  58. package/{logger.d.ts → typings/logger.d.ts} +1 -1
  59. package/typings/parseAndPrintWithCache.d.ts +4 -0
  60. package/typings/pubsub.d.cts +13 -0
  61. package/{pubsub.d.ts → typings/pubsub.d.ts} +3 -2
  62. package/typings/read-file-or-url.d.cts +14 -0
  63. package/{read-file-or-url.d.ts → typings/read-file-or-url.d.ts} +3 -3
  64. package/typings/resolve-additional-resolvers.d.cts +4 -0
  65. package/{resolve-additional-resolvers.d.ts → typings/resolve-additional-resolvers.d.ts} +1 -1
  66. package/typings/sanitize-name-for-graphql.d.cts +2 -0
  67. package/{sanitize-name-for-graphql.d.ts → typings/sanitize-name-for-graphql.d.ts} +1 -0
  68. package/typings/with-cancel.d.cts +1 -0
  69. package/typings/with-cancel.d.ts +1 -0
  70. package/typings/with-cookies.d.cts +3 -0
  71. package/typings/with-cookies.d.ts +3 -0
  72. package/typings/with-filter.d.cts +4 -0
  73. package/typings/with-filter.d.ts +4 -0
  74. package/defaultImportFn.d.ts +0 -1
  75. package/getHeadersObj.d.ts +0 -1
  76. package/index.d.ts +0 -16
  77. package/index.js +0 -1112
  78. package/index.mjs +0 -1054
  79. package/with-cancel.d.ts +0 -1
  80. package/with-filter.d.ts +0 -4
  81. /package/{extract-resolvers.d.ts → typings/extract-resolvers.d.cts} +0 -0
  82. /package/{fileURLToPath.d.ts → typings/fileURLToPath.d.cts} +0 -0
  83. /package/{fs-operations.d.ts → typings/fs-operations.d.cts} +0 -0
  84. /package/{group-transforms.d.ts → typings/group-transforms.d.cts} +0 -0
  85. /package/{parseAndPrintWithCache.d.ts → typings/parseAndPrintWithCache.d.cts} +0 -0
package/package.json CHANGED
@@ -1,24 +1,22 @@
1
1
  {
2
2
  "name": "@graphql-mesh/utils",
3
- "version": "1.0.0-alpha-20220804093904-8e2e41f7f",
3
+ "version": "1.0.0-alpha-20230420220344-25b6b92bf",
4
4
  "sideEffects": false,
5
5
  "peerDependencies": {
6
- "@graphql-mesh/types": "0.79.0-alpha-20220804093904-8e2e41f7f",
7
- "graphql": "*"
6
+ "@graphql-mesh/cross-helpers": "^0.3.4",
7
+ "@graphql-mesh/types": "1.0.0-alpha-20230420220344-25b6b92bf",
8
+ "@graphql-tools/utils": "^9.2.1",
9
+ "graphql": "*",
10
+ "tslib": "^2.4.0"
8
11
  },
9
12
  "dependencies": {
10
- "@graphql-mesh/cross-helpers": "0.2.0",
11
- "@graphql-mesh/string-interpolation": "0.3.0",
12
- "@graphql-tools/delegate": "8.8.1",
13
- "@graphql-tools/utils": "8.9.0",
14
- "@graphql-typed-document-node/core": "3.1.1",
15
- "file-uri-to-path": "2.0.0",
13
+ "@graphql-mesh/string-interpolation": "0.4.4",
14
+ "@graphql-tools/delegate": "9.0.32",
15
+ "dset": "3.1.2",
16
16
  "js-yaml": "4.1.0",
17
17
  "lodash.get": "4.4.2",
18
- "lodash.set": "4.3.2",
19
18
  "lodash.topath": "4.5.2",
20
- "tiny-lru": "8.0.2",
21
- "tslib": "^2.4.0"
19
+ "tiny-lru": "8.0.2"
22
20
  },
23
21
  "repository": {
24
22
  "type": "git",
@@ -26,21 +24,28 @@
26
24
  "directory": "packages/utils"
27
25
  },
28
26
  "license": "MIT",
29
- "main": "index.js",
30
- "module": "index.mjs",
31
- "typings": "index.d.ts",
27
+ "main": "cjs/index.js",
28
+ "module": "esm/index.js",
29
+ "typings": "typings/index.d.ts",
32
30
  "typescript": {
33
- "definition": "index.d.ts"
31
+ "definition": "typings/index.d.ts"
34
32
  },
33
+ "type": "module",
35
34
  "exports": {
36
35
  ".": {
37
- "require": "./index.js",
38
- "import": "./index.mjs"
39
- },
40
- "./*": {
41
- "require": "./*.js",
42
- "import": "./*.mjs"
36
+ "require": {
37
+ "types": "./typings/index.d.cts",
38
+ "default": "./cjs/index.js"
39
+ },
40
+ "import": {
41
+ "types": "./typings/index.d.ts",
42
+ "default": "./esm/index.js"
43
+ },
44
+ "default": {
45
+ "types": "./typings/index.d.ts",
46
+ "default": "./esm/index.js"
47
+ }
43
48
  },
44
49
  "./package.json": "./package.json"
45
50
  }
46
- }
51
+ }
@@ -0,0 +1,6 @@
1
+ import { GraphQLSchema } from 'graphql';
2
+ import { DelegationContext, SubschemaConfig, Transform } from '@graphql-tools/delegate';
3
+ import { ExecutionRequest, ExecutionResult } from '@graphql-tools/utils';
4
+ export declare function applySchemaTransforms(originalWrappingSchema: GraphQLSchema, subschemaConfig: SubschemaConfig, transformedSchema: GraphQLSchema, transforms?: Transform[]): GraphQLSchema;
5
+ export declare function applyRequestTransforms(originalRequest: ExecutionRequest, delegationContext: DelegationContext, transformationContext: Record<string, any>, transforms: Transform[]): ExecutionRequest<any, any, any, Record<string, any>, any>;
6
+ export declare function applyResultTransforms(originalResult: ExecutionResult, delegationContext: DelegationContext, transformationContext: Record<string, any>, transforms: Transform[]): ExecutionResult<any, any>;
@@ -1,6 +1,6 @@
1
1
  import { GraphQLSchema } from 'graphql';
2
2
  import { DelegationContext, SubschemaConfig, Transform } from '@graphql-tools/delegate';
3
- import { ExecutionResult, ExecutionRequest } from '@graphql-tools/utils';
3
+ import { ExecutionRequest, ExecutionResult } from '@graphql-tools/utils';
4
4
  export declare function applySchemaTransforms(originalWrappingSchema: GraphQLSchema, subschemaConfig: SubschemaConfig, transformedSchema: GraphQLSchema, transforms?: Transform[]): GraphQLSchema;
5
- export declare function applyRequestTransforms(originalRequest: ExecutionRequest, delegationContext: DelegationContext, transformationContext: Record<string, any>, transforms: Transform[]): ExecutionRequest<Record<string, any>, any, any, Record<string, any>>;
6
- export declare function applyResultTransforms(originalResult: ExecutionResult, delegationContext: DelegationContext, transformationContext: Record<string, any>, transforms: Transform[]): ExecutionResult<Record<string, any>>;
5
+ export declare function applyRequestTransforms(originalRequest: ExecutionRequest, delegationContext: DelegationContext, transformationContext: Record<string, any>, transforms: Transform[]): ExecutionRequest<any, any, any, Record<string, any>, any>;
6
+ export declare function applyResultTransforms(originalResult: ExecutionResult, delegationContext: DelegationContext, transformationContext: Record<string, any>, transforms: Transform[]): ExecutionResult<any, any>;
@@ -0,0 +1,2 @@
1
+ declare function defaultImportFn(path: string): Promise<any>;
2
+ export { defaultImportFn };
@@ -0,0 +1,2 @@
1
+ declare function defaultImportFn(path: string): Promise<any>;
2
+ export { defaultImportFn };
@@ -0,0 +1,2 @@
1
+ import { GraphQLSchema } from 'graphql';
2
+ export declare function extractResolvers(schema: GraphQLSchema): any;
@@ -0,0 +1 @@
1
+ export declare function fileURLToPath(url: string): string;
@@ -0,0 +1,7 @@
1
+ /// <reference types="node" />
2
+ import { fs } from '@graphql-mesh/cross-helpers';
3
+ export declare function pathExists(path: string): Promise<boolean>;
4
+ export declare function writeJSON<T>(path: string, data: T, replacer?: (this: any, key: string, value: any) => any, space?: string | number): Promise<void>;
5
+ export declare const writeFile: typeof fs.promises.writeFile;
6
+ export declare function mkdir(path: string, options?: fs.MakeDirectoryOptions): Promise<void>;
7
+ export declare function rmdirs(dir: string): Promise<void>;
@@ -0,0 +1 @@
1
+ export declare function getHeadersObj(headers: Headers | Record<string, string> | Map<string, string>): Record<string, string>;
@@ -0,0 +1 @@
1
+ export declare function getHeadersObj(headers: Headers | Record<string, string> | Map<string, string>): Record<string, string>;
@@ -0,0 +1,3 @@
1
+ import { Lru } from 'tiny-lru';
2
+ export type LRUCache = Lru<any>;
3
+ export declare function createLruCache(max?: number, ttl?: number): LRUCache;
@@ -1,3 +1,3 @@
1
1
  import { Lru } from 'tiny-lru';
2
- export declare function createLruCache(max?: number, ttl?: number): Lru<any>;
3
- export declare type LRUCache = Lru;
2
+ export type LRUCache = Lru<any>;
3
+ export declare function createLruCache(max?: number, ttl?: number): LRUCache;
@@ -0,0 +1,5 @@
1
+ import { MeshTransform } from '@graphql-mesh/types';
2
+ export declare function groupTransforms(transforms: MeshTransform[]): {
3
+ wrapTransforms: MeshTransform<any>[];
4
+ noWrapTransforms: MeshTransform<any>[];
5
+ };
@@ -0,0 +1,17 @@
1
+ export * from './read-file-or-url.cjs';
2
+ export * from './load-from-module-export-expression.cjs';
3
+ export * from './with-cancel.cjs';
4
+ export * from './extract-resolvers.cjs';
5
+ export * from './group-transforms.cjs';
6
+ export * from './apply-transforms.cjs';
7
+ export * from './fs-operations.cjs';
8
+ export * from './global-lru-cache.cjs';
9
+ export * from './sanitize-name-for-graphql.cjs';
10
+ export * from './resolve-additional-resolvers.cjs';
11
+ export * from './logger.cjs';
12
+ export * from './parseAndPrintWithCache.cjs';
13
+ export * from './defaultImportFn.cjs';
14
+ export * from './pubsub.cjs';
15
+ export * from './fileURLToPath.cjs';
16
+ export * from './getHeadersObj.cjs';
17
+ export * from './with-cookies.cjs';
@@ -0,0 +1,17 @@
1
+ export * from './read-file-or-url.js';
2
+ export * from './load-from-module-export-expression.js';
3
+ export * from './with-cancel.js';
4
+ export * from './extract-resolvers.js';
5
+ export * from './group-transforms.js';
6
+ export * from './apply-transforms.js';
7
+ export * from './fs-operations.js';
8
+ export * from './global-lru-cache.js';
9
+ export * from './sanitize-name-for-graphql.js';
10
+ export * from './resolve-additional-resolvers.js';
11
+ export * from './logger.js';
12
+ export * from './parseAndPrintWithCache.js';
13
+ export * from './defaultImportFn.js';
14
+ export * from './pubsub.js';
15
+ export * from './fileURLToPath.js';
16
+ export * from './getHeadersObj.js';
17
+ export * from './with-cookies.js';
@@ -0,0 +1,8 @@
1
+ import { ImportFn } from '@graphql-mesh/types';
2
+ type LoadFromModuleExportExpressionOptions = {
3
+ defaultExportName: string;
4
+ cwd: string;
5
+ importFn: ImportFn;
6
+ };
7
+ export declare function loadFromModuleExportExpression<T>(expression: T | string, options: LoadFromModuleExportExpressionOptions): Promise<T>;
8
+ export {};
@@ -1,5 +1,5 @@
1
1
  import { ImportFn } from '@graphql-mesh/types';
2
- declare type LoadFromModuleExportExpressionOptions = {
2
+ type LoadFromModuleExportExpressionOptions = {
3
3
  defaultExportName: string;
4
4
  cwd: string;
5
5
  importFn: ImportFn;
@@ -0,0 +1,22 @@
1
+ import { LazyLoggerMessage, Logger } from '@graphql-mesh/types';
2
+ type MessageTransformer = (msg: string) => string;
3
+ export declare const warnColor: MessageTransformer;
4
+ export declare const infoColor: MessageTransformer;
5
+ export declare const errorColor: MessageTransformer;
6
+ export declare const debugColor: MessageTransformer;
7
+ export declare const titleBold: MessageTransformer;
8
+ export declare class DefaultLogger implements Logger {
9
+ name?: string;
10
+ constructor(name?: string);
11
+ private getLoggerMessage;
12
+ private handleLazyMessage;
13
+ private get isDebug();
14
+ private get prefix();
15
+ log(...args: any[]): void;
16
+ warn(...args: any[]): void;
17
+ info(...args: any[]): void;
18
+ error(...args: any[]): void;
19
+ debug(...lazyArgs: LazyLoggerMessage[]): void;
20
+ child(name: string): Logger;
21
+ }
22
+ export {};
@@ -1,5 +1,5 @@
1
1
  import { LazyLoggerMessage, Logger } from '@graphql-mesh/types';
2
- declare type MessageTransformer = (msg: string) => string;
2
+ type MessageTransformer = (msg: string) => string;
3
3
  export declare const warnColor: MessageTransformer;
4
4
  export declare const infoColor: MessageTransformer;
5
5
  export declare const errorColor: MessageTransformer;
@@ -0,0 +1,4 @@
1
+ import { DocumentNode } from 'graphql';
2
+ export declare function parseWithCache(sdl: string): DocumentNode;
3
+ export declare const printWithCache: (document: DocumentNode) => string;
4
+ export declare function gql([sdl]: TemplateStringsArray, ...args: (DocumentNode | string)[]): DocumentNode;
@@ -0,0 +1,13 @@
1
+ import { AllHooks, HookName, MeshPubSub } from '@graphql-mesh/types';
2
+ type Listener<THookName extends HookName = HookName> = (data: AllHooks[THookName]) => void;
3
+ export declare class PubSub implements MeshPubSub {
4
+ private subIdListenerMap;
5
+ private listenerEventMap;
6
+ private eventNameListenersMap;
7
+ getEventNames(): Iterable<string>;
8
+ publish<THook extends HookName>(triggerName: THook, detail: AllHooks[THook]): void;
9
+ subscribe<THook extends HookName>(triggerName: THook, onMessage: Listener<THook>): number;
10
+ unsubscribe(subId: number): void;
11
+ asyncIterator<THook extends HookName>(triggerName: THook): AsyncIterable<AllHooks[THook]>;
12
+ }
13
+ export {};
@@ -1,9 +1,10 @@
1
- import { HookName, AllHooks, MeshPubSub } from '@graphql-mesh/types';
2
- declare type Listener<THookName extends HookName = HookName> = (data: AllHooks[THookName]) => void;
1
+ import { AllHooks, HookName, MeshPubSub } from '@graphql-mesh/types';
2
+ type Listener<THookName extends HookName = HookName> = (data: AllHooks[THookName]) => void;
3
3
  export declare class PubSub implements MeshPubSub {
4
4
  private subIdListenerMap;
5
5
  private listenerEventMap;
6
6
  private eventNameListenersMap;
7
+ getEventNames(): Iterable<string>;
7
8
  publish<THook extends HookName>(triggerName: THook, detail: AllHooks[THook]): void;
8
9
  subscribe<THook extends HookName>(triggerName: THook, onMessage: Listener<THook>): number;
9
10
  unsubscribe(subId: number): void;
@@ -0,0 +1,14 @@
1
+ import { ImportFn, Logger, MeshFetch, MeshFetchRequestInit } from '@graphql-mesh/types';
2
+ export interface ReadFileOrUrlOptions extends MeshFetchRequestInit {
3
+ allowUnknownExtensions?: boolean;
4
+ fallbackFormat?: 'json' | 'yaml' | 'js' | 'ts';
5
+ cwd: string;
6
+ fetch: MeshFetch;
7
+ importFn: ImportFn;
8
+ logger: Logger;
9
+ }
10
+ export declare function isUrl(str: string): boolean;
11
+ export declare function readFileOrUrl<T>(filePathOrUrl: string, config: ReadFileOrUrlOptions): Promise<T>;
12
+ export declare function loadYaml(filepath: string, content: string, logger: Logger): any;
13
+ export declare function readFile<T>(fileExpression: string, { allowUnknownExtensions, cwd, fallbackFormat, importFn, logger }: ReadFileOrUrlOptions): Promise<T>;
14
+ export declare function readUrl<T>(path: string, config: ReadFileOrUrlOptions): Promise<T>;
@@ -1,9 +1,9 @@
1
- import { ImportFn, Logger } from '@graphql-mesh/types';
2
- export interface ReadFileOrUrlOptions extends RequestInit {
1
+ import { ImportFn, Logger, MeshFetch, MeshFetchRequestInit } from '@graphql-mesh/types';
2
+ export interface ReadFileOrUrlOptions extends MeshFetchRequestInit {
3
3
  allowUnknownExtensions?: boolean;
4
4
  fallbackFormat?: 'json' | 'yaml' | 'js' | 'ts';
5
5
  cwd: string;
6
- fetch: typeof fetch;
6
+ fetch: MeshFetch;
7
7
  importFn: ImportFn;
8
8
  logger: Logger;
9
9
  }
@@ -0,0 +1,4 @@
1
+ import { ImportFn, MeshPubSub, YamlConfig } from '@graphql-mesh/types';
2
+ import { IResolvers } from '@graphql-tools/utils';
3
+ export declare function resolveAdditionalResolversWithoutImport(additionalResolver: YamlConfig.AdditionalStitchingResolverObject | YamlConfig.AdditionalSubscriptionObject | YamlConfig.AdditionalStitchingBatchResolverObject, pubsub: MeshPubSub): IResolvers;
4
+ export declare function resolveAdditionalResolvers(baseDir: string, additionalResolvers: (string | YamlConfig.AdditionalStitchingResolverObject | YamlConfig.AdditionalSubscriptionObject | YamlConfig.AdditionalStitchingBatchResolverObject)[], importFn: ImportFn, pubsub: MeshPubSub): Promise<IResolvers[]>;
@@ -1,4 +1,4 @@
1
- import { YamlConfig, MeshPubSub, ImportFn } from '@graphql-mesh/types';
1
+ import { ImportFn, MeshPubSub, YamlConfig } from '@graphql-mesh/types';
2
2
  import { IResolvers } from '@graphql-tools/utils';
3
3
  export declare function resolveAdditionalResolversWithoutImport(additionalResolver: YamlConfig.AdditionalStitchingResolverObject | YamlConfig.AdditionalSubscriptionObject | YamlConfig.AdditionalStitchingBatchResolverObject, pubsub: MeshPubSub): IResolvers;
4
4
  export declare function resolveAdditionalResolvers(baseDir: string, additionalResolvers: (string | YamlConfig.AdditionalStitchingResolverObject | YamlConfig.AdditionalSubscriptionObject | YamlConfig.AdditionalStitchingBatchResolverObject)[], importFn: ImportFn, pubsub: MeshPubSub): Promise<IResolvers[]>;
@@ -0,0 +1,2 @@
1
+ export declare function removeClosedBrackets(val: string): string;
2
+ export declare function sanitizeNameForGraphQL(unsafeName: string): string;
@@ -1 +1,2 @@
1
+ export declare function removeClosedBrackets(val: string): string;
1
2
  export declare function sanitizeNameForGraphQL(unsafeName: string): string;
@@ -0,0 +1 @@
1
+ export declare function withCancel<T, TAsyncIterable extends AsyncIterable<T>>(asyncIterable: TAsyncIterable, onCancel: () => void): AsyncIterable<T | undefined>;
@@ -0,0 +1 @@
1
+ export declare function withCancel<T, TAsyncIterable extends AsyncIterable<T>>(asyncIterable: TAsyncIterable, onCancel: () => void): AsyncIterable<T | undefined>;
@@ -0,0 +1,3 @@
1
+ export declare const withCookies: (request: Request & {
2
+ cookies?: Record<string, string>;
3
+ }) => void;
@@ -0,0 +1,3 @@
1
+ export declare const withCookies: (request: Request & {
2
+ cookies?: Record<string, string>;
3
+ }) => void;
@@ -0,0 +1,4 @@
1
+ export type FilterFn<TSource = any, TArgs = any, TContext = any> = (rootValue?: TSource, args?: TArgs, context?: TContext, info?: any) => boolean | Promise<boolean>;
2
+ export type ResolverFn<TSource = any, TArgs = any, TContext = any> = (rootValue?: TSource, args?: TArgs, context?: TContext, info?: any) => AsyncIterator<any> | Promise<AsyncIterator<any>>;
3
+ export type WithFilter<TSource = any, TArgs = any, TContext = any> = (asyncIteratorFn: ResolverFn<TSource, TArgs, TContext>, filterFn: FilterFn<TSource, TArgs, TContext>) => ResolverFn<TSource, TArgs, TContext>;
4
+ export declare function withFilter<TSource = any, TArgs = any, TContext = any>(asyncIteratorFn: ResolverFn<TSource, TArgs, TContext>, filterFn: FilterFn<TSource, TArgs, TContext>): ResolverFn<TSource, TArgs, TContext>;
@@ -0,0 +1,4 @@
1
+ export type FilterFn<TSource = any, TArgs = any, TContext = any> = (rootValue?: TSource, args?: TArgs, context?: TContext, info?: any) => boolean | Promise<boolean>;
2
+ export type ResolverFn<TSource = any, TArgs = any, TContext = any> = (rootValue?: TSource, args?: TArgs, context?: TContext, info?: any) => AsyncIterator<any> | Promise<AsyncIterator<any>>;
3
+ export type WithFilter<TSource = any, TArgs = any, TContext = any> = (asyncIteratorFn: ResolverFn<TSource, TArgs, TContext>, filterFn: FilterFn<TSource, TArgs, TContext>) => ResolverFn<TSource, TArgs, TContext>;
4
+ export declare function withFilter<TSource = any, TArgs = any, TContext = any>(asyncIteratorFn: ResolverFn<TSource, TArgs, TContext>, filterFn: FilterFn<TSource, TArgs, TContext>): ResolverFn<TSource, TArgs, TContext>;
@@ -1 +0,0 @@
1
- export declare function defaultImportFn(path: string): Promise<any>;
@@ -1 +0,0 @@
1
- export declare function getHeadersObj(headers: Headers): Record<string, string>;
package/index.d.ts DELETED
@@ -1,16 +0,0 @@
1
- export * from './read-file-or-url';
2
- export * from './load-from-module-export-expression';
3
- export * from './with-cancel';
4
- export * from './extract-resolvers';
5
- export * from './group-transforms';
6
- export * from './apply-transforms';
7
- export * from './fs-operations';
8
- export * from './global-lru-cache';
9
- export * from './sanitize-name-for-graphql';
10
- export * from './resolve-additional-resolvers';
11
- export * from './logger';
12
- export * from './parseAndPrintWithCache';
13
- export * from './defaultImportFn';
14
- export * from './pubsub';
15
- export * from './fileURLToPath';
16
- export * from './getHeadersObj';