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