@graphql-tools/utils 8.2.0-alpha-aa385bc9.0 → 8.2.3
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/comments.d.ts +3 -1
- package/fixSchemaAst.d.ts +3 -0
- package/index.d.ts +1 -0
- package/index.js +53 -23
- package/index.mjs +53 -25
- package/package.json +1 -1
- package/es5/AggregateError.d.ts +0 -10
- package/es5/Interfaces.d.ts +0 -242
- package/es5/addTypes.d.ts +0 -2
- package/es5/astFromType.d.ts +0 -2
- package/es5/astFromValueUntyped.d.ts +0 -17
- package/es5/build-operation-for-field.d.ts +0 -18
- package/es5/collectFields.d.ts +0 -5
- package/es5/comments.d.ts +0 -28
- package/es5/errors.d.ts +0 -2
- package/es5/executor.d.ts +0 -7
- package/es5/fields.d.ts +0 -5
- package/es5/filterSchema.d.ts +0 -12
- package/es5/forEachDefaultValue.d.ts +0 -3
- package/es5/forEachField.d.ts +0 -3
- package/es5/get-directives.d.ts +0 -11
- package/es5/get-fields-with-directives.d.ts +0 -16
- package/es5/get-implementing-types.d.ts +0 -2
- package/es5/getArgumentValues.d.ts +0 -10
- package/es5/getObjectTypeFromTypeMap.d.ts +0 -3
- package/es5/getResolversFromSchema.d.ts +0 -3
- package/es5/getResponseKeyFromInfo.d.ts +0 -7
- package/es5/heal.d.ts +0 -3
- package/es5/helpers.d.ts +0 -9
- package/es5/implementsAbstractType.d.ts +0 -3
- package/es5/index.d.ts +0 -48
- package/es5/index.js +0 -4818
- package/es5/index.mjs +0 -4712
- package/es5/inspect.d.ts +0 -4
- package/es5/isAsyncIterable.d.ts +0 -1
- package/es5/isDocumentNode.d.ts +0 -2
- package/es5/loaders.d.ts +0 -18
- package/es5/mapAsyncIterator.d.ts +0 -5
- package/es5/mapSchema.d.ts +0 -7
- package/es5/memoize.d.ts +0 -6
- package/es5/mergeDeep.d.ts +0 -9
- package/es5/observableToAsyncIterable.d.ts +0 -12
- package/es5/package.json +0 -35
- package/es5/parse-graphql-json.d.ts +0 -4
- package/es5/parse-graphql-sdl.d.ts +0 -13
- package/es5/print-schema-with-directives.d.ts +0 -21
- package/es5/prune.d.ts +0 -8
- package/es5/renameType.d.ts +0 -8
- package/es5/rewire.d.ts +0 -5
- package/es5/rootTypes.d.ts +0 -5
- package/es5/selectionSets.d.ts +0 -3
- package/es5/stub.d.ts +0 -9
- package/es5/transformInputValue.d.ts +0 -6
- package/es5/types.d.ts +0 -49
- package/es5/updateArgument.d.ts +0 -3
- package/es5/validate-documents.d.ts +0 -9
- package/es5/valueMatchesCriteria.d.ts +0 -1
- package/es5/visitResult.d.ts +0 -15
- package/es5/withCancel.d.ts +0 -3
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { GraphQLSchema, OperationDefinitionNode, OperationTypeNode } from 'graphql';
|
|
2
|
-
export declare type Skip = string[];
|
|
3
|
-
export declare type Force = string[];
|
|
4
|
-
export declare type Ignore = string[];
|
|
5
|
-
export declare type SelectedFields = {
|
|
6
|
-
[key: string]: SelectedFields;
|
|
7
|
-
} | boolean;
|
|
8
|
-
export declare function buildOperationNodeForField({ schema, kind, field, models, ignore, depthLimit, circularReferenceDepth, argNames, selectedFields, }: {
|
|
9
|
-
schema: GraphQLSchema;
|
|
10
|
-
kind: OperationTypeNode;
|
|
11
|
-
field: string;
|
|
12
|
-
models?: string[];
|
|
13
|
-
ignore?: Ignore;
|
|
14
|
-
depthLimit?: number;
|
|
15
|
-
circularReferenceDepth?: number;
|
|
16
|
-
argNames?: string[];
|
|
17
|
-
selectedFields?: SelectedFields;
|
|
18
|
-
}): OperationDefinitionNode;
|
package/es5/collectFields.d.ts
DELETED
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import { GraphQLSchema, FragmentDefinitionNode, GraphQLObjectType, SelectionSetNode, FieldNode } from 'graphql';
|
|
2
|
-
export declare function collectFields(schema: GraphQLSchema, fragments: Record<string, FragmentDefinitionNode>, variableValues: {
|
|
3
|
-
[variable: string]: unknown;
|
|
4
|
-
}, runtimeType: GraphQLObjectType, selectionSet: SelectionSetNode, fields: Map<string, Array<FieldNode>>, visitedFragmentNames: Set<string>): Map<string, Array<FieldNode>>;
|
|
5
|
-
export declare const collectSubFields: (schema: GraphQLSchema, fragments: Record<string, FragmentDefinitionNode>, variableValues: Record<string, any>, type: GraphQLObjectType, fieldNodes: Array<FieldNode>) => Map<string, Array<FieldNode>>;
|
package/es5/comments.d.ts
DELETED
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import { StringValueNode, ASTNode, NameNode, DefinitionNode, Location } from 'graphql';
|
|
2
|
-
export declare type NamedDefinitionNode = DefinitionNode & {
|
|
3
|
-
name?: NameNode;
|
|
4
|
-
};
|
|
5
|
-
export declare function resetComments(): void;
|
|
6
|
-
export declare function collectComment(node: NamedDefinitionNode): void;
|
|
7
|
-
export declare function pushComment(node: any, entity: string, field?: string, argument?: string): void;
|
|
8
|
-
export declare function printComment(comment: string): string;
|
|
9
|
-
/**
|
|
10
|
-
* Converts an AST into a string, using one set of reasonable
|
|
11
|
-
* formatting rules.
|
|
12
|
-
*/
|
|
13
|
-
export declare function printWithComments(ast: ASTNode): string;
|
|
14
|
-
export declare function getDescription(node: {
|
|
15
|
-
description?: StringValueNode;
|
|
16
|
-
loc?: Location;
|
|
17
|
-
}, options?: {
|
|
18
|
-
commentDescriptions?: boolean;
|
|
19
|
-
}): string | undefined;
|
|
20
|
-
export declare function getLeadingCommentBlock(node: {
|
|
21
|
-
description?: StringValueNode;
|
|
22
|
-
loc?: Location;
|
|
23
|
-
}): void | string;
|
|
24
|
-
export declare function dedentBlockStringValue(rawString: string): string;
|
|
25
|
-
/**
|
|
26
|
-
* @internal
|
|
27
|
-
*/
|
|
28
|
-
export declare function getBlockStringIndentation(lines: ReadonlyArray<string>): number;
|
package/es5/errors.d.ts
DELETED
package/es5/executor.d.ts
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { ExecutionResult, ExecutionRequest } from './Interfaces';
|
|
2
|
-
declare type MaybePromise<T> = Promise<T> | T;
|
|
3
|
-
declare type MaybeAsyncIterableIterator<T> = AsyncIterableIterator<T> | T;
|
|
4
|
-
export declare type AsyncExecutor<TBaseContext = Record<string, any>, TBaseExtensions = Record<string, any>> = <TReturn = any, TArgs = Record<string, any>, TContext extends TBaseContext = TBaseContext, TRoot = any, TExtensions extends TBaseExtensions = TBaseExtensions>(request: ExecutionRequest<TArgs, TContext, TRoot, TExtensions>) => Promise<MaybeAsyncIterableIterator<ExecutionResult<TReturn>>>;
|
|
5
|
-
export declare type SyncExecutor<TBaseContext = Record<string, any>, TBaseExtensions = Record<string, any>> = <TReturn = any, TArgs = Record<string, any>, TContext extends TBaseContext = TBaseContext, TRoot = any, TExtensions extends TBaseExtensions = TBaseExtensions>(request: ExecutionRequest<TArgs, TContext, TRoot, TExtensions>) => ExecutionResult<TReturn>;
|
|
6
|
-
export declare type Executor<TBaseContext = Record<string, any>, TBaseExtensions = Record<string, any>> = <TReturn = any, TArgs = Record<string, any>, TContext extends TBaseContext = TBaseContext, TRoot = any, TExtensions extends TBaseExtensions = TBaseExtensions>(request: ExecutionRequest<TArgs, TContext, TRoot, TExtensions>) => MaybePromise<MaybeAsyncIterableIterator<ExecutionResult<TReturn>>>;
|
|
7
|
-
export {};
|
package/es5/fields.d.ts
DELETED
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import { GraphQLFieldConfigMap, GraphQLFieldConfig, GraphQLSchema } from 'graphql';
|
|
2
|
-
export declare function appendObjectFields(schema: GraphQLSchema, typeName: string, additionalFields: GraphQLFieldConfigMap<any, any>): GraphQLSchema;
|
|
3
|
-
export declare function removeObjectFields(schema: GraphQLSchema, typeName: string, testFn: (fieldName: string, field: GraphQLFieldConfig<any, any>) => boolean): [GraphQLSchema, GraphQLFieldConfigMap<any, any>];
|
|
4
|
-
export declare function selectObjectFields(schema: GraphQLSchema, typeName: string, testFn: (fieldName: string, field: GraphQLFieldConfig<any, any>) => boolean): GraphQLFieldConfigMap<any, any>;
|
|
5
|
-
export declare function modifyObjectFields(schema: GraphQLSchema, typeName: string, testFn: (fieldName: string, field: GraphQLFieldConfig<any, any>) => boolean, newFields: GraphQLFieldConfigMap<any, any>): [GraphQLSchema, GraphQLFieldConfigMap<any, any>];
|
package/es5/filterSchema.d.ts
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { GraphQLSchema } from 'graphql';
|
|
2
|
-
import { FieldFilter, RootFieldFilter, TypeFilter, ArgumentFilter } from './Interfaces';
|
|
3
|
-
export declare function filterSchema({ schema, typeFilter, fieldFilter, rootFieldFilter, objectFieldFilter, interfaceFieldFilter, inputObjectFieldFilter, argumentFilter, }: {
|
|
4
|
-
schema: GraphQLSchema;
|
|
5
|
-
rootFieldFilter?: RootFieldFilter;
|
|
6
|
-
typeFilter?: TypeFilter;
|
|
7
|
-
fieldFilter?: FieldFilter;
|
|
8
|
-
objectFieldFilter?: FieldFilter;
|
|
9
|
-
interfaceFieldFilter?: FieldFilter;
|
|
10
|
-
inputObjectFieldFilter?: FieldFilter;
|
|
11
|
-
argumentFilter?: ArgumentFilter;
|
|
12
|
-
}): GraphQLSchema;
|
package/es5/forEachField.d.ts
DELETED
package/es5/get-directives.d.ts
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { GraphQLSchema, GraphQLNamedType, GraphQLField, GraphQLInputField, GraphQLFieldConfig, GraphQLInputFieldConfig, GraphQLSchemaConfig, GraphQLObjectTypeConfig, GraphQLInterfaceTypeConfig, GraphQLUnionTypeConfig, GraphQLScalarTypeConfig, GraphQLEnumTypeConfig, GraphQLInputObjectTypeConfig, GraphQLEnumValue, GraphQLEnumValueConfig } from 'graphql';
|
|
2
|
-
export interface DirectiveAnnotation {
|
|
3
|
-
name: string;
|
|
4
|
-
args?: Record<string, any>;
|
|
5
|
-
}
|
|
6
|
-
declare type DirectableGraphQLObject = GraphQLSchema | GraphQLSchemaConfig | GraphQLNamedType | GraphQLObjectTypeConfig<any, any> | GraphQLInterfaceTypeConfig<any, any> | GraphQLUnionTypeConfig<any, any> | GraphQLScalarTypeConfig<any, any> | GraphQLEnumTypeConfig | GraphQLEnumValue | GraphQLEnumValueConfig | GraphQLInputObjectTypeConfig | GraphQLField<any, any> | GraphQLInputField | GraphQLFieldConfig<any, any> | GraphQLInputFieldConfig;
|
|
7
|
-
export declare function getDirectivesInExtensions(node: DirectableGraphQLObject, pathToDirectivesInExtensions?: string[]): Array<DirectiveAnnotation>;
|
|
8
|
-
export declare function getDirectiveInExtensions(node: DirectableGraphQLObject, directiveName: string, pathToDirectivesInExtensions?: string[]): Array<Record<string, any>> | undefined;
|
|
9
|
-
export declare function getDirectives(schema: GraphQLSchema, node: DirectableGraphQLObject, pathToDirectivesInExtensions?: string[]): Array<DirectiveAnnotation>;
|
|
10
|
-
export declare function getDirective(schema: GraphQLSchema, node: DirectableGraphQLObject, directiveName: string, pathToDirectivesInExtensions?: string[]): Array<Record<string, any>> | undefined;
|
|
11
|
-
export {};
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { DocumentNode } from 'graphql';
|
|
2
|
-
export declare type DirectiveArgs = {
|
|
3
|
-
[name: string]: any;
|
|
4
|
-
};
|
|
5
|
-
export declare type DirectiveUsage = {
|
|
6
|
-
name: string;
|
|
7
|
-
args: DirectiveArgs;
|
|
8
|
-
};
|
|
9
|
-
export declare type TypeAndFieldToDirectives = {
|
|
10
|
-
[typeAndField: string]: DirectiveUsage[];
|
|
11
|
-
};
|
|
12
|
-
interface Options {
|
|
13
|
-
includeInputTypes?: boolean;
|
|
14
|
-
}
|
|
15
|
-
export declare function getFieldsWithDirectives(documentNode: DocumentNode, options?: Options): TypeAndFieldToDirectives;
|
|
16
|
-
export {};
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { GraphQLField, GraphQLDirective, DirectiveNode, FieldNode } from 'graphql';
|
|
2
|
-
/**
|
|
3
|
-
* Prepares an object map of argument values given a list of argument
|
|
4
|
-
* definitions and list of argument AST nodes.
|
|
5
|
-
*
|
|
6
|
-
* Note: The returned value is a plain Object with a prototype, since it is
|
|
7
|
-
* exposed to user code. Care should be taken to not pull values from the
|
|
8
|
-
* Object prototype.
|
|
9
|
-
*/
|
|
10
|
-
export declare function getArgumentValues(def: GraphQLField<any, any> | GraphQLDirective, node: FieldNode | DirectiveNode, variableValues?: Record<string, any>): Record<string, any>;
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { GraphQLResolveInfo } from 'graphql';
|
|
2
|
-
/**
|
|
3
|
-
* Get the key under which the result of this resolver will be placed in the response JSON. Basically, just
|
|
4
|
-
* resolves aliases.
|
|
5
|
-
* @param info The info argument to the resolver.
|
|
6
|
-
*/
|
|
7
|
-
export declare function getResponseKeyFromInfo(info: GraphQLResolveInfo): string;
|
package/es5/heal.d.ts
DELETED
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import { GraphQLDirective, GraphQLNamedType, GraphQLSchema } from 'graphql';
|
|
2
|
-
export declare function healSchema(schema: GraphQLSchema): GraphQLSchema;
|
|
3
|
-
export declare function healTypes(originalTypeMap: Record<string, GraphQLNamedType | null>, directives: ReadonlyArray<GraphQLDirective>): void;
|
package/es5/helpers.d.ts
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { ASTNode } from 'graphql';
|
|
2
|
-
export declare const asArray: <T>(fns: T | T[]) => T[];
|
|
3
|
-
export declare function isDocumentString(str: any): boolean;
|
|
4
|
-
export declare function isValidPath(str: any): boolean;
|
|
5
|
-
export declare function compareStrings<A, B>(a: A, b: B): 1 | -1 | 0;
|
|
6
|
-
export declare function nodeToString(a: ASTNode): string;
|
|
7
|
-
export declare function compareNodes(a: ASTNode, b: ASTNode, customFn?: (a: any, b: any) => number): number;
|
|
8
|
-
export declare function isSome<T>(input: T): input is Exclude<T, null | undefined>;
|
|
9
|
-
export declare function assertSome<T>(input: T, message?: string): asserts input is Exclude<T, null | undefined>;
|
package/es5/index.d.ts
DELETED
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
export * from './loaders';
|
|
2
|
-
export * from './helpers';
|
|
3
|
-
export * from './get-directives';
|
|
4
|
-
export * from './get-fields-with-directives';
|
|
5
|
-
export * from './get-implementing-types';
|
|
6
|
-
export * from './print-schema-with-directives';
|
|
7
|
-
export * from './get-fields-with-directives';
|
|
8
|
-
export * from './validate-documents';
|
|
9
|
-
export * from './parse-graphql-json';
|
|
10
|
-
export * from './parse-graphql-sdl';
|
|
11
|
-
export * from './build-operation-for-field';
|
|
12
|
-
export * from './types';
|
|
13
|
-
export * from './filterSchema';
|
|
14
|
-
export * from './heal';
|
|
15
|
-
export * from './getResolversFromSchema';
|
|
16
|
-
export * from './forEachField';
|
|
17
|
-
export * from './forEachDefaultValue';
|
|
18
|
-
export * from './mapSchema';
|
|
19
|
-
export * from './addTypes';
|
|
20
|
-
export * from './rewire';
|
|
21
|
-
export * from './prune';
|
|
22
|
-
export * from './mergeDeep';
|
|
23
|
-
export * from './Interfaces';
|
|
24
|
-
export * from './stub';
|
|
25
|
-
export * from './selectionSets';
|
|
26
|
-
export * from './getResponseKeyFromInfo';
|
|
27
|
-
export * from './fields';
|
|
28
|
-
export * from './renameType';
|
|
29
|
-
export * from './transformInputValue';
|
|
30
|
-
export * from './mapAsyncIterator';
|
|
31
|
-
export * from './updateArgument';
|
|
32
|
-
export * from './implementsAbstractType';
|
|
33
|
-
export * from './errors';
|
|
34
|
-
export * from './observableToAsyncIterable';
|
|
35
|
-
export * from './visitResult';
|
|
36
|
-
export * from './getArgumentValues';
|
|
37
|
-
export * from './valueMatchesCriteria';
|
|
38
|
-
export * from './isAsyncIterable';
|
|
39
|
-
export * from './isDocumentNode';
|
|
40
|
-
export * from './astFromValueUntyped';
|
|
41
|
-
export * from './executor';
|
|
42
|
-
export * from './withCancel';
|
|
43
|
-
export * from './AggregateError';
|
|
44
|
-
export * from './rootTypes';
|
|
45
|
-
export * from './comments';
|
|
46
|
-
export * from './collectFields';
|
|
47
|
-
export * from './inspect';
|
|
48
|
-
export * from './memoize';
|