@graphql-tools/merge 8.1.2 → 8.1.3-alpha-881b29e4.0

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.
@@ -1,37 +0,0 @@
1
- import { IResolvers, Maybe } from '@graphql-tools/utils';
2
- /**
3
- * Additional options for merging resolvers
4
- */
5
- export interface MergeResolversOptions {
6
- exclusions?: string[];
7
- }
8
- /**
9
- * Deep merges multiple resolver definition objects into a single definition.
10
- * @param resolversDefinitions Resolver definitions to be merged
11
- * @param options Additional options
12
- *
13
- * ```js
14
- * const { mergeResolvers } = require('@graphql-tools/merge');
15
- * const clientResolver = require('./clientResolver');
16
- * const productResolver = require('./productResolver');
17
- *
18
- * const resolvers = mergeResolvers([
19
- * clientResolver,
20
- * productResolver,
21
- * ]);
22
- * ```
23
- *
24
- * If you don't want to manually create the array of resolver objects, you can
25
- * also use this function along with loadFiles:
26
- *
27
- * ```js
28
- * const path = require('path');
29
- * const { mergeResolvers } = require('@graphql-tools/merge');
30
- * const { loadFilesSync } = require('@graphql-tools/load-files');
31
- *
32
- * const resolversArray = loadFilesSync(path.join(__dirname, './resolvers'));
33
- *
34
- * const resolvers = mergeResolvers(resolversArray)
35
- * ```
36
- */
37
- export declare function mergeResolvers<TSource, TContext>(resolversDefinitions: Maybe<IResolvers<TSource, TContext>> | Maybe<Maybe<IResolvers<TSource, TContext>>[]>, options?: MergeResolversOptions): IResolvers<TSource, TContext>;
package/es5/package.json DELETED
@@ -1,36 +0,0 @@
1
- {
2
- "name": "@graphql-tools/merge/es5",
3
- "version": "8.1.2",
4
- "description": "A set of utils for faster development of GraphQL tools",
5
- "sideEffects": false,
6
- "peerDependencies": {
7
- "graphql": "^14.0.0 || ^15.0.0 || ^16.0.0"
8
- },
9
- "dependencies": {
10
- "@graphql-tools/utils": "^8.2.2",
11
- "tslib": "~2.3.0"
12
- },
13
- "repository": {
14
- "type": "git",
15
- "url": "ardatan/graphql-tools",
16
- "directory": "packages/merge"
17
- },
18
- "author": "Dotan Simha <dotansimha@gmail.com>",
19
- "license": "MIT",
20
- "main": "index.js",
21
- "module": "index.mjs",
22
- "typings": "index.d.ts",
23
- "typescript": {
24
- "definition": "index.d.ts"
25
- },
26
- "exports": {
27
- ".": {
28
- "require": "./index.js",
29
- "import": "./index.mjs"
30
- },
31
- "./*": {
32
- "require": "./*.js",
33
- "import": "./*.mjs"
34
- }
35
- }
36
- }
@@ -1,3 +0,0 @@
1
- import { InputValueDefinitionNode } from 'graphql';
2
- import { Config } from '.';
3
- export declare function mergeArguments(args1: InputValueDefinitionNode[], args2: InputValueDefinitionNode[], config?: Config): InputValueDefinitionNode[];
@@ -1,4 +0,0 @@
1
- import { DirectiveNode, DirectiveDefinitionNode } from 'graphql';
2
- import { Config } from './merge-typedefs';
3
- export declare function mergeDirectives(d1?: ReadonlyArray<DirectiveNode>, d2?: ReadonlyArray<DirectiveNode>, config?: Config): DirectiveNode[];
4
- export declare function mergeDirective(node: DirectiveDefinitionNode, existingNode?: DirectiveDefinitionNode): DirectiveDefinitionNode;
@@ -1,3 +0,0 @@
1
- import { EnumValueDefinitionNode } from 'graphql';
2
- import { Config } from './merge-typedefs';
3
- export declare function mergeEnumValues(first: ReadonlyArray<EnumValueDefinitionNode> | undefined, second: ReadonlyArray<EnumValueDefinitionNode> | undefined, config?: Config): EnumValueDefinitionNode[];
@@ -1,3 +0,0 @@
1
- import { EnumTypeDefinitionNode, EnumTypeExtensionNode } from 'graphql';
2
- import { Config } from './merge-typedefs';
3
- export declare function mergeEnum(e1: EnumTypeDefinitionNode | EnumTypeExtensionNode, e2: EnumTypeDefinitionNode | EnumTypeExtensionNode, config?: Config): EnumTypeDefinitionNode | EnumTypeExtensionNode;
@@ -1,5 +0,0 @@
1
- import { Config } from './merge-typedefs';
2
- import { FieldDefinitionNode, InputValueDefinitionNode, NameNode } from 'graphql';
3
- export declare function mergeFields<T extends FieldDefinitionNode | InputValueDefinitionNode>(type: {
4
- name: NameNode;
5
- }, f1: ReadonlyArray<T> | undefined, f2: ReadonlyArray<T> | undefined, config?: Config): T[];
@@ -1,14 +0,0 @@
1
- export * from './arguments';
2
- export * from './directives';
3
- export * from './enum-values';
4
- export * from './enum';
5
- export * from './fields';
6
- export * from './input-type';
7
- export * from './interface';
8
- export * from './merge-named-type-array';
9
- export * from './merge-nodes';
10
- export * from './merge-typedefs';
11
- export * from './scalar';
12
- export * from './type';
13
- export * from './union';
14
- export * from './utils';
@@ -1,3 +0,0 @@
1
- import { Config } from './merge-typedefs';
2
- import { InputObjectTypeDefinitionNode, InputObjectTypeExtensionNode } from 'graphql';
3
- export declare function mergeInputType(node: InputObjectTypeDefinitionNode | InputObjectTypeExtensionNode, existingNode: InputObjectTypeDefinitionNode | InputObjectTypeExtensionNode, config?: Config): InputObjectTypeDefinitionNode | InputObjectTypeExtensionNode;
@@ -1,3 +0,0 @@
1
- import { Config } from './merge-typedefs';
2
- import { InterfaceTypeDefinitionNode, InterfaceTypeExtensionNode } from 'graphql';
3
- export declare function mergeInterface(node: InterfaceTypeDefinitionNode | InterfaceTypeExtensionNode, existingNode: InterfaceTypeDefinitionNode | InterfaceTypeExtensionNode, config?: Config): InterfaceTypeDefinitionNode | InterfaceTypeExtensionNode;
@@ -1,3 +0,0 @@
1
- import { NamedTypeNode } from 'graphql';
2
- import { Config } from '.';
3
- export declare function mergeNamedTypeArray(first?: ReadonlyArray<NamedTypeNode>, second?: ReadonlyArray<NamedTypeNode>, config?: Config): NamedTypeNode[];
@@ -1,9 +0,0 @@
1
- import { Config } from './merge-typedefs';
2
- import { DefinitionNode, SchemaDefinitionNode, SchemaExtensionNode } from 'graphql';
3
- import { NamedDefinitionNode } from '@graphql-tools/utils';
4
- export declare const schemaDefSymbol = "SCHEMA_DEF_SYMBOL";
5
- export declare type MergedResultMap = Record<string, NamedDefinitionNode> & {
6
- [schemaDefSymbol]: SchemaDefinitionNode | SchemaExtensionNode;
7
- };
8
- export declare function isNamedDefinitionNode(definitionNode: DefinitionNode): definitionNode is NamedDefinitionNode;
9
- export declare function mergeGraphQLNodes(nodes: ReadonlyArray<DefinitionNode>, config?: Config): MergedResultMap;
@@ -1,68 +0,0 @@
1
- import { DefinitionNode, DocumentNode, ParseOptions } from 'graphql';
2
- import { CompareFn } from './utils';
3
- import { GetDocumentNodeFromSchemaOptions, TypeSource } from '@graphql-tools/utils';
4
- declare type Omit<T, K extends keyof any> = Pick<T, Exclude<keyof T, K>>;
5
- export interface Config extends ParseOptions, GetDocumentNodeFromSchemaOptions {
6
- /**
7
- * Produces `schema { query: ..., mutation: ..., subscription: ... }`
8
- *
9
- * Default: true
10
- */
11
- useSchemaDefinition?: boolean;
12
- /**
13
- * Creates schema definition, even when no types are available
14
- * Produces: `schema { query: Query }`
15
- *
16
- * Default: false
17
- */
18
- forceSchemaDefinition?: boolean;
19
- /**
20
- * Throws an error on a merge conflict
21
- *
22
- * Default: false
23
- */
24
- throwOnConflict?: boolean;
25
- /**
26
- * Descriptions are defined as preceding string literals, however an older
27
- * experimental version of the SDL supported preceding comments as
28
- * descriptions. Set to true to enable this deprecated behavior.
29
- * This option is provided to ease adoption and will be removed in v16.
30
- *
31
- * Default: false
32
- */
33
- commentDescriptions?: boolean;
34
- /**
35
- * Puts the next directive first.
36
- *
37
- * Default: false
38
- *
39
- * @example:
40
- * Given:
41
- * ```graphql
42
- * type User { a: String @foo }
43
- * type User { a: String @bar }
44
- * ```
45
- *
46
- * Results:
47
- * ```
48
- * type User { a: @bar @foo }
49
- * ```
50
- */
51
- reverseDirectives?: boolean;
52
- exclusions?: string[];
53
- sort?: boolean | CompareFn<string>;
54
- convertExtensions?: boolean;
55
- consistentEnumMerge?: boolean;
56
- ignoreFieldConflicts?: boolean;
57
- }
58
- /**
59
- * Merges multiple type definitions into a single `DocumentNode`
60
- * @param types The type definitions to be merged
61
- */
62
- export declare function mergeTypeDefs(typeSource: TypeSource): DocumentNode;
63
- export declare function mergeTypeDefs(typeSource: TypeSource, config?: Partial<Config> & {
64
- commentDescriptions: true;
65
- }): string;
66
- export declare function mergeTypeDefs(typeSource: TypeSource, config?: Omit<Partial<Config>, 'commentDescriptions'>): DocumentNode;
67
- export declare function mergeGraphQLTypes(typeSource: TypeSource, config: Config): DefinitionNode[];
68
- export {};
@@ -1,3 +0,0 @@
1
- import { ScalarTypeDefinitionNode, ScalarTypeExtensionNode } from 'graphql';
2
- import { Config } from './merge-typedefs';
3
- export declare function mergeScalar(node: ScalarTypeDefinitionNode | ScalarTypeExtensionNode, existingNode: ScalarTypeDefinitionNode | ScalarTypeExtensionNode, config?: Config): ScalarTypeDefinitionNode | ScalarTypeExtensionNode;
@@ -1,8 +0,0 @@
1
- import { SchemaDefinitionNode, SchemaExtensionNode } from 'graphql';
2
- import { Config } from './merge-typedefs';
3
- export declare const DEFAULT_OPERATION_TYPE_NAME_MAP: {
4
- readonly query: "Query";
5
- readonly mutation: "Mutation";
6
- readonly subscription: "Subscription";
7
- };
8
- export declare function mergeSchemaDefs(node: SchemaDefinitionNode | SchemaExtensionNode, existingNode: SchemaDefinitionNode | SchemaExtensionNode, config?: Config): SchemaDefinitionNode | SchemaExtensionNode;
@@ -1,3 +0,0 @@
1
- import { Config } from './merge-typedefs';
2
- import { ObjectTypeDefinitionNode, ObjectTypeExtensionNode } from 'graphql';
3
- export declare function mergeType(node: ObjectTypeDefinitionNode | ObjectTypeExtensionNode, existingNode: ObjectTypeDefinitionNode | ObjectTypeExtensionNode, config?: Config): ObjectTypeDefinitionNode | ObjectTypeExtensionNode;
@@ -1,3 +0,0 @@
1
- import { UnionTypeDefinitionNode, UnionTypeExtensionNode } from 'graphql';
2
- import { Config } from './merge-typedefs';
3
- export declare function mergeUnion(first: UnionTypeDefinitionNode | UnionTypeExtensionNode, second: UnionTypeDefinitionNode | UnionTypeExtensionNode, config?: Config): UnionTypeDefinitionNode | UnionTypeExtensionNode;
@@ -1,15 +0,0 @@
1
- import { TypeNode, NamedTypeNode, ListTypeNode, NonNullTypeNode, Source } from 'graphql';
2
- export declare function isStringTypes(types: any): types is string;
3
- export declare function isSourceTypes(types: any): types is Source;
4
- export declare function extractType(type: TypeNode): NamedTypeNode;
5
- export declare function isWrappingTypeNode(type: TypeNode): type is ListTypeNode | NonNullTypeNode;
6
- export declare function isListTypeNode(type: TypeNode): type is ListTypeNode;
7
- export declare function isNonNullTypeNode(type: TypeNode): type is NonNullTypeNode;
8
- export declare function printTypeNode(type: TypeNode): string;
9
- export declare enum CompareVal {
10
- A_SMALLER_THAN_B = -1,
11
- A_EQUALS_B = 0,
12
- A_GREATER_THAN_B = 1
13
- }
14
- export declare type CompareFn<T> = (a: T | undefined, b: T | undefined) => -1 | 0 | 1;
15
- export declare function defaultStringComparator(a: string | undefined, b: string | undefined): CompareVal;