@wundergraph/composition 0.10.1 → 0.11.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/dist/ast/utils.js +2 -0
- package/dist/ast/utils.js.map +1 -1
- package/dist/errors/errors.d.ts +5 -1
- package/dist/errors/errors.js +27 -4
- package/dist/errors/errors.js.map +1 -1
- package/dist/federation/federation-factory.d.ts +4 -3
- package/dist/federation/federation-factory.js +20 -45
- package/dist/federation/federation-factory.js.map +1 -1
- package/dist/federation/utils.d.ts +2 -0
- package/dist/federation/utils.js.map +1 -1
- package/dist/normalization/normalization-factory.d.ts +20 -6
- package/dist/normalization/normalization-factory.js +292 -49
- package/dist/normalization/normalization-factory.js.map +1 -1
- package/dist/subgraph/subgraph.d.ts +12 -4
- package/dist/subgraph/subgraph.js +20 -4
- package/dist/subgraph/subgraph.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/utils/string-constants.d.ts +1 -0
- package/dist/utils/string-constants.js +3 -2
- package/dist/utils/string-constants.js.map +1 -1
- package/dist/utils/utils.d.ts +1 -0
- package/dist/utils/utils.js +9 -1
- package/dist/utils/utils.js.map +1 -1
- package/package.json +2 -2
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { ConstDirectiveNode, DocumentNode, GraphQLSchema, Kind } from 'graphql';
|
|
2
2
|
import { ArgumentConfigurationData } from '../subgraph/field-configuration';
|
|
3
3
|
import { MutableDirectiveDefinitionNode, MutableEnumTypeDefinitionNode, MutableEnumValueDefinitionNode, MutableFieldDefinitionNode, MutableInputObjectTypeDefinitionNode, MutableInputValueDefinitionNode, MutableInterfaceTypeDefinitionNode, MutableObjectTypeDefinitionNode, MutableObjectTypeExtensionNode, MutableScalarTypeDefinitionNode, MutableUnionTypeDefinitionNode } from '../ast/ast';
|
|
4
|
+
import { SubgraphConfig } from '../subgraph/subgraph';
|
|
4
5
|
export type FederationResultContainer = {
|
|
5
6
|
errors?: Error[];
|
|
6
7
|
federationResult?: FederationResult;
|
|
@@ -9,6 +10,7 @@ export type FederationResult = {
|
|
|
9
10
|
argumentConfigurations: ArgumentConfigurationData[];
|
|
10
11
|
federatedGraphAST: DocumentNode;
|
|
11
12
|
federatedGraphSchema: GraphQLSchema;
|
|
13
|
+
subgraphConfigBySubgraphName: Map<string, SubgraphConfig>;
|
|
12
14
|
};
|
|
13
15
|
export type RootTypeFieldData = {
|
|
14
16
|
fieldName: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../src/federation/utils.ts"],"names":[],"mappings":";;;AAeA,gEAQmC;
|
|
1
|
+
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../src/federation/utils.ts"],"names":[],"mappings":";;;AAeA,gEAQmC;AAuBtB,QAAA,8BAA8B,GAAG,IAAI,GAAG,CAAS;IAC5D,8BAAW,EAAE,4CAAyB,EAAE,wCAAqB;IAC7D,wCAAqB,EAAE,iCAAc,EAAE,8BAAW,EAAE,qCAAkB;CACvE,CAAC,CAAC;AAEH,IAAY,WAIX;AAJD,WAAY,WAAW;IACrB,+CAAK,CAAA;IACL,6DAAY,CAAA;IACZ,yDAAU,CAAA;AACZ,CAAC,EAJW,WAAW,2BAAX,WAAW,QAItB;AAaD,SAAgB,+BAA+B;IAC7C,OAAO;QACL,UAAU,EAAE,EAAE;QACd,UAAU,EAAE,IAAI,GAAG,EAAgC;QACnD,IAAI,EAAE,IAAI,GAAG,EAA8B;KAC5C,CAAC;AACJ,CAAC;AAND,0EAMC"}
|
|
@@ -1,12 +1,14 @@
|
|
|
1
|
-
import { ConstDirectiveNode, DirectiveDefinitionNode, DocumentNode, EnumValueDefinitionNode, FieldDefinitionNode, GraphQLSchema, InputValueDefinitionNode, InterfaceTypeDefinitionNode, InterfaceTypeExtensionNode, Kind, NamedTypeNode, ObjectTypeDefinitionNode, ObjectTypeExtensionNode, OperationTypeNode, SchemaDefinitionNode, SchemaExtensionNode, TypeDefinitionNode, TypeExtensionNode, TypeNode } from 'graphql';
|
|
1
|
+
import { ConstDirectiveNode, DirectiveDefinitionNode, DirectiveNode, DocumentNode, EnumValueDefinitionNode, FieldDefinitionNode, GraphQLSchema, InputValueDefinitionNode, InterfaceTypeDefinitionNode, InterfaceTypeExtensionNode, Kind, NamedTypeNode, ObjectTypeDefinitionNode, ObjectTypeExtensionNode, OperationTypeNode, SchemaDefinitionNode, SchemaExtensionNode, TypeDefinitionNode, TypeExtensionNode, TypeNode } from 'graphql';
|
|
2
2
|
import { ChildContainer, ExtensionContainer, ExtensionMap, FieldContainer, FieldSetContainer, InputValidationContainer, ObjectExtensionContainer, ObjectLikeContainer, ParentContainer, ParentMap, SchemaContainer, UnionContainer, UnionExtensionContainer } from './utils';
|
|
3
3
|
import { ConfigurationData, ConfigurationDataMap } from '../subgraph/field-configuration';
|
|
4
4
|
import { MutableInputValueDefinitionNode } from '../ast/ast';
|
|
5
|
+
import { InternalSubgraph, Subgraph } from '../subgraph/subgraph';
|
|
5
6
|
export type NormalizationResult = {
|
|
6
7
|
configurationDataMap: ConfigurationDataMap;
|
|
7
8
|
isVersionTwo: boolean;
|
|
8
9
|
keyFieldsByParentTypeName: Map<string, Set<string>>;
|
|
9
10
|
operationTypes: Map<string, OperationTypeNode>;
|
|
11
|
+
overridesByTargetSubgraphName: Map<string, Map<string, Set<string>>>;
|
|
10
12
|
schema: GraphQLSchema;
|
|
11
13
|
subgraphAST: DocumentNode;
|
|
12
14
|
subgraphString: string;
|
|
@@ -15,25 +17,34 @@ export type NormalizationResultContainer = {
|
|
|
15
17
|
errors?: Error[];
|
|
16
18
|
normalizationResult?: NormalizationResult;
|
|
17
19
|
};
|
|
18
|
-
export
|
|
20
|
+
export type BatchNormalizationContainer = {
|
|
21
|
+
errors?: Error[];
|
|
22
|
+
internalSubgraphsBySubgraphName: Map<string, InternalSubgraph>;
|
|
23
|
+
};
|
|
24
|
+
export declare function normalizeSubgraphFromString(subgraphSDL: string): NormalizationResultContainer;
|
|
19
25
|
export declare function normalizeSubgraph(document: DocumentNode): NormalizationResultContainer;
|
|
20
26
|
export declare class NormalizationFactory {
|
|
21
27
|
abstractToConcreteTypeNames: Map<string, Set<string>>;
|
|
22
28
|
allDirectiveDefinitions: Map<string, DirectiveDefinitionNode>;
|
|
29
|
+
argumentName: string;
|
|
30
|
+
childName: string;
|
|
23
31
|
configurationDataMap: Map<string, ConfigurationData>;
|
|
24
32
|
customDirectiveDefinitions: Map<string, DirectiveDefinitionNode>;
|
|
25
33
|
errors: Error[];
|
|
26
34
|
entities: Set<string>;
|
|
35
|
+
extensions: ExtensionMap;
|
|
36
|
+
isCurrentParentExtension: boolean;
|
|
37
|
+
isSubgraphVersionTwo: boolean;
|
|
27
38
|
fieldSetsByParent: Map<string, FieldSetContainer>;
|
|
39
|
+
handledRepeatedDirectivesByHostPath: Map<string, Set<string>>;
|
|
40
|
+
lastParentNodeKind: Kind;
|
|
41
|
+
lastChildNodeKind: Kind;
|
|
28
42
|
keyFieldsByParentTypeName: Map<string, Set<string>>;
|
|
29
43
|
operationTypeNames: Map<string, OperationTypeNode>;
|
|
30
44
|
parents: ParentMap;
|
|
31
45
|
parentTypeName: string;
|
|
32
46
|
parentsWithChildArguments: Set<string>;
|
|
33
|
-
|
|
34
|
-
isChild: boolean;
|
|
35
|
-
isCurrentParentExtension: boolean;
|
|
36
|
-
isSubgraphVersionTwo: boolean;
|
|
47
|
+
overridesByTargetSubgraphName: Map<string, Map<string, Set<string>>>;
|
|
37
48
|
schemaDefinition: SchemaContainer;
|
|
38
49
|
referencedDirectives: Set<string>;
|
|
39
50
|
referencedTypeNames: Set<string>;
|
|
@@ -53,6 +64,7 @@ export declare class NormalizationFactory {
|
|
|
53
64
|
isTypeValidImplementation(originalType: TypeNode, implementationType: TypeNode): boolean;
|
|
54
65
|
extractKeyFieldSets(node: ObjectTypeDefinitionNode | ObjectTypeExtensionNode, rawFieldSets: Set<string>): void;
|
|
55
66
|
validateInterfaceImplementations(container: ObjectLikeContainer): void;
|
|
67
|
+
handleOverride(node: DirectiveNode, fieldName: string): void;
|
|
56
68
|
normalize(document: DocumentNode): {
|
|
57
69
|
errors: Error[];
|
|
58
70
|
normalizationResult?: undefined;
|
|
@@ -62,6 +74,7 @@ export declare class NormalizationFactory {
|
|
|
62
74
|
isVersionTwo: boolean;
|
|
63
75
|
keyFieldsByParentTypeName: Map<string, Set<string>>;
|
|
64
76
|
operationTypes: Map<string, OperationTypeNode>;
|
|
77
|
+
overridesByTargetSubgraphName: Map<string, Map<string, Set<string>>>;
|
|
65
78
|
subgraphAST: DocumentNode;
|
|
66
79
|
subgraphString: string;
|
|
67
80
|
schema: GraphQLSchema;
|
|
@@ -69,3 +82,4 @@ export declare class NormalizationFactory {
|
|
|
69
82
|
errors?: undefined;
|
|
70
83
|
};
|
|
71
84
|
}
|
|
85
|
+
export declare function batchNormalize(subgraphs: Subgraph[]): BatchNormalizationContainer;
|