@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.
- package/cjs/apply-transforms.js +35 -0
- package/cjs/defaultImportFn.js +57 -0
- package/cjs/extract-resolvers.js +23 -0
- package/cjs/fileURLToPath.js +50 -0
- package/cjs/fs-operations.js +65 -0
- package/cjs/getHeadersObj.js +61 -0
- package/cjs/global-lru-cache.js +9 -0
- package/cjs/group-transforms.js +17 -0
- package/cjs/index.js +20 -0
- package/cjs/load-from-module-export-expression.js +29 -0
- package/cjs/logger.js +127 -0
- package/cjs/package.json +1 -0
- package/cjs/parseAndPrintWithCache.js +42 -0
- package/cjs/pubsub.js +57 -0
- package/cjs/read-file-or-url.js +132 -0
- package/cjs/resolve-additional-resolvers.js +350 -0
- package/cjs/sanitize-name-for-graphql.js +96 -0
- package/cjs/with-cancel.js +34 -0
- package/cjs/with-cookies.js +18 -0
- package/cjs/with-filter.js +53 -0
- package/esm/apply-transforms.js +29 -0
- package/esm/defaultImportFn.js +32 -0
- package/esm/extract-resolvers.js +19 -0
- package/esm/fileURLToPath.js +46 -0
- package/esm/fs-operations.js +57 -0
- package/esm/getHeadersObj.js +57 -0
- package/esm/global-lru-cache.js +4 -0
- package/esm/group-transforms.js +13 -0
- package/esm/index.js +17 -0
- package/esm/load-from-module-export-expression.js +25 -0
- package/esm/logger.js +118 -0
- package/esm/parseAndPrintWithCache.js +37 -0
- package/esm/pubsub.js +53 -0
- package/esm/read-file-or-url.js +124 -0
- package/esm/resolve-additional-resolvers.js +344 -0
- package/esm/sanitize-name-for-graphql.js +91 -0
- package/esm/with-cancel.js +30 -0
- package/esm/with-cookies.js +14 -0
- package/esm/with-filter.js +49 -0
- package/package.json +28 -23
- package/typings/apply-transforms.d.cts +6 -0
- package/{apply-transforms.d.ts → typings/apply-transforms.d.ts} +3 -3
- package/typings/defaultImportFn.d.cts +2 -0
- package/typings/defaultImportFn.d.ts +2 -0
- package/typings/extract-resolvers.d.ts +2 -0
- package/typings/fileURLToPath.d.ts +1 -0
- package/typings/fs-operations.d.ts +7 -0
- package/typings/getHeadersObj.d.cts +1 -0
- package/typings/getHeadersObj.d.ts +1 -0
- package/typings/global-lru-cache.d.cts +3 -0
- package/{global-lru-cache.d.ts → typings/global-lru-cache.d.ts} +2 -2
- package/typings/group-transforms.d.ts +5 -0
- package/typings/index.d.cts +17 -0
- package/typings/index.d.ts +17 -0
- package/typings/load-from-module-export-expression.d.cts +8 -0
- package/{load-from-module-export-expression.d.ts → typings/load-from-module-export-expression.d.ts} +1 -1
- package/typings/logger.d.cts +22 -0
- package/{logger.d.ts → typings/logger.d.ts} +1 -1
- package/typings/parseAndPrintWithCache.d.ts +4 -0
- package/typings/pubsub.d.cts +13 -0
- package/{pubsub.d.ts → typings/pubsub.d.ts} +3 -2
- package/typings/read-file-or-url.d.cts +14 -0
- package/{read-file-or-url.d.ts → typings/read-file-or-url.d.ts} +3 -3
- package/typings/resolve-additional-resolvers.d.cts +4 -0
- package/{resolve-additional-resolvers.d.ts → typings/resolve-additional-resolvers.d.ts} +1 -1
- package/typings/sanitize-name-for-graphql.d.cts +2 -0
- package/{sanitize-name-for-graphql.d.ts → typings/sanitize-name-for-graphql.d.ts} +1 -0
- package/typings/with-cancel.d.cts +1 -0
- package/typings/with-cancel.d.ts +1 -0
- package/typings/with-cookies.d.cts +3 -0
- package/typings/with-cookies.d.ts +3 -0
- package/typings/with-filter.d.cts +4 -0
- package/typings/with-filter.d.ts +4 -0
- package/defaultImportFn.d.ts +0 -1
- package/getHeadersObj.d.ts +0 -1
- package/index.d.ts +0 -16
- package/index.js +0 -1112
- package/index.mjs +0 -1054
- package/with-cancel.d.ts +0 -1
- package/with-filter.d.ts +0 -4
- /package/{extract-resolvers.d.ts → typings/extract-resolvers.d.cts} +0 -0
- /package/{fileURLToPath.d.ts → typings/fileURLToPath.d.cts} +0 -0
- /package/{fs-operations.d.ts → typings/fs-operations.d.cts} +0 -0
- /package/{group-transforms.d.ts → typings/group-transforms.d.cts} +0 -0
- /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-
|
|
3
|
+
"version": "1.0.0-alpha-20230420220344-25b6b92bf",
|
|
4
4
|
"sideEffects": false,
|
|
5
5
|
"peerDependencies": {
|
|
6
|
-
"@graphql-mesh/
|
|
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/
|
|
11
|
-
"@graphql-
|
|
12
|
-
"
|
|
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.
|
|
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":
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
"
|
|
42
|
-
|
|
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 {
|
|
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<
|
|
6
|
-
export declare function applyResultTransforms(originalResult: ExecutionResult, delegationContext: DelegationContext, transformationContext: Record<string, any>, transforms: Transform[]): ExecutionResult<
|
|
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 @@
|
|
|
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>;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { Lru } from 'tiny-lru';
|
|
2
|
-
export
|
|
3
|
-
export declare
|
|
2
|
+
export type LRUCache = Lru<any>;
|
|
3
|
+
export declare function createLruCache(max?: number, ttl?: number): LRUCache;
|
|
@@ -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 {};
|
|
@@ -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
|
-
|
|
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 {
|
|
2
|
-
|
|
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
|
|
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:
|
|
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 {
|
|
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 @@
|
|
|
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,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>;
|
package/defaultImportFn.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function defaultImportFn(path: string): Promise<any>;
|
package/getHeadersObj.d.ts
DELETED
|
@@ -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';
|