@graphql-tools/stitching-directives 3.1.13 → 3.1.14-alpha-09de1d3da51074c5901decc7efd24f43af24378f

Sign up to get free protection for your applications and to get access to all the features.
Files changed (59) hide show
  1. package/CHANGELOG.md +929 -0
  2. package/dist/index.cjs +1196 -0
  3. package/dist/index.d.cts +58 -0
  4. package/dist/index.d.ts +58 -0
  5. package/dist/index.js +1193 -0
  6. package/package.json +32 -42
  7. package/cjs/defaultStitchingDirectiveOptions.js +0 -10
  8. package/cjs/extractVariables.js +0 -52
  9. package/cjs/federationToStitchingSDL.js +0 -116
  10. package/cjs/getSourcePaths.js +0 -25
  11. package/cjs/index.js +0 -6
  12. package/cjs/package.json +0 -1
  13. package/cjs/parseMergeArgsExpr.js +0 -77
  14. package/cjs/pathsFromSelectionSet.js +0 -29
  15. package/cjs/preparseMergeArgsExpr.js +0 -31
  16. package/cjs/properties.js +0 -70
  17. package/cjs/stitchingDirectives.js +0 -78
  18. package/cjs/stitchingDirectivesTransformer.js +0 -490
  19. package/cjs/stitchingDirectivesValidator.js +0 -119
  20. package/cjs/types.js +0 -0
  21. package/esm/defaultStitchingDirectiveOptions.js +0 -7
  22. package/esm/extractVariables.js +0 -48
  23. package/esm/federationToStitchingSDL.js +0 -112
  24. package/esm/getSourcePaths.js +0 -21
  25. package/esm/index.js +0 -3
  26. package/esm/parseMergeArgsExpr.js +0 -73
  27. package/esm/pathsFromSelectionSet.js +0 -25
  28. package/esm/preparseMergeArgsExpr.js +0 -27
  29. package/esm/properties.js +0 -63
  30. package/esm/stitchingDirectives.js +0 -74
  31. package/esm/stitchingDirectivesTransformer.js +0 -486
  32. package/esm/stitchingDirectivesValidator.js +0 -115
  33. package/esm/types.js +0 -0
  34. package/typings/defaultStitchingDirectiveOptions.d.cts +0 -2
  35. package/typings/defaultStitchingDirectiveOptions.d.ts +0 -2
  36. package/typings/extractVariables.d.cts +0 -7
  37. package/typings/extractVariables.d.ts +0 -7
  38. package/typings/federationToStitchingSDL.d.cts +0 -2
  39. package/typings/federationToStitchingSDL.d.ts +0 -2
  40. package/typings/getSourcePaths.d.cts +0 -3
  41. package/typings/getSourcePaths.d.ts +0 -3
  42. package/typings/index.d.cts +0 -3
  43. package/typings/index.d.ts +0 -3
  44. package/typings/parseMergeArgsExpr.d.cts +0 -3
  45. package/typings/parseMergeArgsExpr.d.ts +0 -3
  46. package/typings/pathsFromSelectionSet.d.cts +0 -2
  47. package/typings/pathsFromSelectionSet.d.ts +0 -2
  48. package/typings/preparseMergeArgsExpr.d.cts +0 -6
  49. package/typings/preparseMergeArgsExpr.d.ts +0 -6
  50. package/typings/properties.d.cts +0 -5
  51. package/typings/properties.d.ts +0 -5
  52. package/typings/stitchingDirectives.d.cts +0 -19
  53. package/typings/stitchingDirectives.d.ts +0 -19
  54. package/typings/stitchingDirectivesTransformer.d.cts +0 -3
  55. package/typings/stitchingDirectivesTransformer.d.ts +0 -3
  56. package/typings/stitchingDirectivesValidator.d.cts +0 -3
  57. package/typings/stitchingDirectivesValidator.d.ts +0 -3
  58. package/typings/types.d.cts +0 -35
  59. package/typings/types.d.ts +0 -35
@@ -1,2 +0,0 @@
1
- import { SelectionSetNode } from 'graphql';
2
- export declare function pathsFromSelectionSet(selectionSet: SelectionSetNode, path?: Array<string>): Array<Array<string>>;
@@ -1,2 +0,0 @@
1
- import { SelectionSetNode } from 'graphql';
2
- export declare function pathsFromSelectionSet(selectionSet: SelectionSetNode, path?: Array<string>): Array<Array<string>>;
@@ -1,6 +0,0 @@
1
- export declare const KEY_DELIMITER = "__dot__";
2
- export declare const EXPANSION_PREFIX = "__exp";
3
- export declare function preparseMergeArgsExpr(mergeArgsExpr: string): {
4
- mergeArgsExpr: string;
5
- expansionExpressions: Record<string, string>;
6
- };
@@ -1,6 +0,0 @@
1
- export declare const KEY_DELIMITER = "__dot__";
2
- export declare const EXPANSION_PREFIX = "__exp";
3
- export declare function preparseMergeArgsExpr(mergeArgsExpr: string): {
4
- mergeArgsExpr: string;
5
- expansionExpressions: Record<string, string>;
6
- };
@@ -1,5 +0,0 @@
1
- import { PropertyTree } from './types.cjs';
2
- export declare function addProperty(object: Record<string, any>, path: Array<string | number>, value: any): void;
3
- export declare function getProperty(object: Record<string, any>, path: Array<string>): any;
4
- export declare function getProperties(object: Record<string, any>, propertyTree: PropertyTree): any;
5
- export declare function propertyTreeFromPaths(paths: Array<Array<string>>): PropertyTree;
@@ -1,5 +0,0 @@
1
- import { PropertyTree } from './types.js';
2
- export declare function addProperty(object: Record<string, any>, path: Array<string | number>, value: any): void;
3
- export declare function getProperty(object: Record<string, any>, path: Array<string>): any;
4
- export declare function getProperties(object: Record<string, any>, propertyTree: PropertyTree): any;
5
- export declare function propertyTreeFromPaths(paths: Array<Array<string>>): PropertyTree;
@@ -1,19 +0,0 @@
1
- import { GraphQLDirective, GraphQLSchema } from 'graphql';
2
- import { SubschemaConfig } from '@graphql-tools/delegate';
3
- import { StitchingDirectivesOptions } from './types.cjs';
4
- export interface StitchingDirectivesResult {
5
- keyDirectiveTypeDefs: string;
6
- computedDirectiveTypeDefs: string;
7
- mergeDirectiveTypeDefs: string;
8
- canonicalDirectiveTypeDefs: string;
9
- stitchingDirectivesTypeDefs: string;
10
- allStitchingDirectivesTypeDefs: string;
11
- stitchingDirectivesValidator: (schema: GraphQLSchema) => GraphQLSchema;
12
- stitchingDirectivesTransformer: (subschemaConfig: SubschemaConfig) => SubschemaConfig;
13
- keyDirective: GraphQLDirective;
14
- computedDirective: GraphQLDirective;
15
- mergeDirective: GraphQLDirective;
16
- canonicalDirective: GraphQLDirective;
17
- allStitchingDirectives: Array<GraphQLDirective>;
18
- }
19
- export declare function stitchingDirectives(options?: StitchingDirectivesOptions): StitchingDirectivesResult;
@@ -1,19 +0,0 @@
1
- import { GraphQLDirective, GraphQLSchema } from 'graphql';
2
- import { SubschemaConfig } from '@graphql-tools/delegate';
3
- import { StitchingDirectivesOptions } from './types.js';
4
- export interface StitchingDirectivesResult {
5
- keyDirectiveTypeDefs: string;
6
- computedDirectiveTypeDefs: string;
7
- mergeDirectiveTypeDefs: string;
8
- canonicalDirectiveTypeDefs: string;
9
- stitchingDirectivesTypeDefs: string;
10
- allStitchingDirectivesTypeDefs: string;
11
- stitchingDirectivesValidator: (schema: GraphQLSchema) => GraphQLSchema;
12
- stitchingDirectivesTransformer: (subschemaConfig: SubschemaConfig) => SubschemaConfig;
13
- keyDirective: GraphQLDirective;
14
- computedDirective: GraphQLDirective;
15
- mergeDirective: GraphQLDirective;
16
- canonicalDirective: GraphQLDirective;
17
- allStitchingDirectives: Array<GraphQLDirective>;
18
- }
19
- export declare function stitchingDirectives(options?: StitchingDirectivesOptions): StitchingDirectivesResult;
@@ -1,3 +0,0 @@
1
- import { SubschemaConfig } from '@graphql-tools/delegate';
2
- import { StitchingDirectivesOptions } from './types.cjs';
3
- export declare function stitchingDirectivesTransformer(options?: StitchingDirectivesOptions): (subschemaConfig: SubschemaConfig) => SubschemaConfig;
@@ -1,3 +0,0 @@
1
- import { SubschemaConfig } from '@graphql-tools/delegate';
2
- import { StitchingDirectivesOptions } from './types.js';
3
- export declare function stitchingDirectivesTransformer(options?: StitchingDirectivesOptions): (subschemaConfig: SubschemaConfig) => SubschemaConfig;
@@ -1,3 +0,0 @@
1
- import { GraphQLSchema } from 'graphql';
2
- import { StitchingDirectivesOptions } from './types.cjs';
3
- export declare function stitchingDirectivesValidator(options?: StitchingDirectivesOptions): (schema: GraphQLSchema) => GraphQLSchema;
@@ -1,3 +0,0 @@
1
- import { GraphQLSchema } from 'graphql';
2
- import { StitchingDirectivesOptions } from './types.js';
3
- export declare function stitchingDirectivesValidator(options?: StitchingDirectivesOptions): (schema: GraphQLSchema) => GraphQLSchema;
@@ -1,35 +0,0 @@
1
- export interface PropertyTree {
2
- [property: string]: null | PropertyTree;
3
- }
4
- export interface ParsedMergeArgsExpr {
5
- args: Record<string, any>;
6
- usedProperties: PropertyTree;
7
- mappingInstructions?: Array<MappingInstruction>;
8
- expansions?: Array<Expansion>;
9
- }
10
- export interface MappingInstruction {
11
- destinationPath: Array<string>;
12
- sourcePath: Array<string>;
13
- }
14
- export interface Expansion {
15
- valuePath: Array<string>;
16
- value: any;
17
- mappingInstructions: Array<MappingInstruction>;
18
- }
19
- export type VariablePaths = Record<string, Array<string | number>>;
20
- export interface StitchingDirectivesOptions {
21
- keyDirectiveName?: string;
22
- computedDirectiveName?: string;
23
- mergeDirectiveName?: string;
24
- canonicalDirectiveName?: string;
25
- pathToDirectivesInExtensions?: Array<string>;
26
- }
27
- type Complete<T> = {
28
- [P in keyof Required<T>]: Exclude<Pick<T, P> extends Required<Pick<T, P>> ? T[P] : T[P] | undefined, undefined>;
29
- };
30
- export type StitchingDirectivesFinalOptions = Complete<StitchingDirectivesOptions>;
31
- export interface MergedTypeResolverInfo extends ParsedMergeArgsExpr {
32
- fieldName: string;
33
- returnsList: boolean;
34
- }
35
- export {};
@@ -1,35 +0,0 @@
1
- export interface PropertyTree {
2
- [property: string]: null | PropertyTree;
3
- }
4
- export interface ParsedMergeArgsExpr {
5
- args: Record<string, any>;
6
- usedProperties: PropertyTree;
7
- mappingInstructions?: Array<MappingInstruction>;
8
- expansions?: Array<Expansion>;
9
- }
10
- export interface MappingInstruction {
11
- destinationPath: Array<string>;
12
- sourcePath: Array<string>;
13
- }
14
- export interface Expansion {
15
- valuePath: Array<string>;
16
- value: any;
17
- mappingInstructions: Array<MappingInstruction>;
18
- }
19
- export type VariablePaths = Record<string, Array<string | number>>;
20
- export interface StitchingDirectivesOptions {
21
- keyDirectiveName?: string;
22
- computedDirectiveName?: string;
23
- mergeDirectiveName?: string;
24
- canonicalDirectiveName?: string;
25
- pathToDirectivesInExtensions?: Array<string>;
26
- }
27
- type Complete<T> = {
28
- [P in keyof Required<T>]: Exclude<Pick<T, P> extends Required<Pick<T, P>> ? T[P] : T[P] | undefined, undefined>;
29
- };
30
- export type StitchingDirectivesFinalOptions = Complete<StitchingDirectivesOptions>;
31
- export interface MergedTypeResolverInfo extends ParsedMergeArgsExpr {
32
- fieldName: string;
33
- returnsList: boolean;
34
- }
35
- export {};