@graphql-tools/utils 7.5.2 → 7.7.1
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/es5/executor.d.ts +13 -0
- package/es5/index.cjs.js +4 -0
- package/es5/index.cjs.js.map +1 -1
- package/es5/index.d.ts +1 -0
- package/es5/index.esm.js +4 -0
- package/es5/index.esm.js.map +1 -1
- package/es5/package.json +1 -1
- package/es5/types.d.ts +7 -1
- package/executor.d.ts +13 -0
- package/index.cjs.js +4 -0
- package/index.cjs.js.map +1 -1
- package/index.d.ts +1 -0
- package/index.esm.js +4 -0
- package/index.esm.js.map +1 -1
- package/package.json +1 -1
- package/types.d.ts +7 -1
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { DocumentNode, GraphQLResolveInfo } from 'graphql';
|
|
2
|
+
import { ExecutionResult } from './Interfaces';
|
|
3
|
+
export interface ExecutionParams<TArgs = Record<string, any>, TContext = any> {
|
|
4
|
+
document: DocumentNode;
|
|
5
|
+
variables?: TArgs;
|
|
6
|
+
extensions?: Record<string, any>;
|
|
7
|
+
context?: TContext;
|
|
8
|
+
info?: GraphQLResolveInfo;
|
|
9
|
+
}
|
|
10
|
+
export declare type AsyncExecutor<TBaseContext = Record<string, any>> = <TReturn = Record<string, any>, TArgs = Record<string, any>, TContext = TBaseContext>(params: ExecutionParams<TArgs, TContext>) => Promise<ExecutionResult<TReturn>>;
|
|
11
|
+
export declare type SyncExecutor<TBaseContext = Record<string, any>> = <TReturn = Record<string, any>, TArgs = Record<string, any>, TContext = TBaseContext>(params: ExecutionParams<TArgs, TContext>) => ExecutionResult<TReturn>;
|
|
12
|
+
export declare type Executor<TBaseContext = Record<string, any>> = <TReturn = Record<string, any>, TArgs = Record<string, any>, TContext = TBaseContext>(params: ExecutionParams<TArgs, TContext>) => ExecutionResult<TReturn> | Promise<ExecutionResult<TReturn>>;
|
|
13
|
+
export declare type Subscriber<TBaseContext = Record<string, any>> = <TReturn = Record<string, any>, TArgs = Record<string, any>, TContext = TBaseContext>(params: ExecutionParams<TArgs, TContext>) => Promise<AsyncIterator<ExecutionResult<TReturn>> | ExecutionResult<TReturn>>;
|
package/es5/index.cjs.js
CHANGED
|
@@ -3488,6 +3488,10 @@ function pruneSchema(schema, options) {
|
|
|
3488
3488
|
visitTypes(pruningContext, schema);
|
|
3489
3489
|
return mapSchema(schema, (_a = {},
|
|
3490
3490
|
_a[exports.MapperKind.TYPE] = function (type) {
|
|
3491
|
+
// If we should NOT prune the type, return it immediately as unmodified
|
|
3492
|
+
if (options.skipPruning && options.skipPruning(type)) {
|
|
3493
|
+
return type;
|
|
3494
|
+
}
|
|
3491
3495
|
if (graphql.isObjectType(type) || graphql.isInputObjectType(type)) {
|
|
3492
3496
|
if ((!Object.keys(type.getFields()).length && !options.skipEmptyCompositeTypePruning) ||
|
|
3493
3497
|
(pruningContext.unusedTypes[type.name] && !options.skipUnusedTypesPruning)) {
|