@wundergraph/composition 0.0.1 → 0.3.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.
- package/LICENSE +197 -14
- package/README.md +140 -1
- package/dist/ast/ast.d.ts +2 -0
- package/dist/ast/ast.js.map +1 -1
- package/dist/ast/utils.d.ts +7 -7
- package/dist/ast/utils.js +30 -16
- package/dist/ast/utils.js.map +1 -1
- package/dist/errors/errors.d.ts +8 -4
- package/dist/errors/errors.js +67 -10
- package/dist/errors/errors.js.map +1 -1
- package/dist/federation/federation-factory.d.ts +6 -5
- package/dist/federation/federation-factory.js +105 -30
- package/dist/federation/federation-factory.js.map +1 -1
- package/dist/federation/federation-result.d.ts +2 -2
- package/dist/federation/federation-result.js +0 -7
- package/dist/federation/federation-result.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/normalization/normalization-factory.d.ts +9 -3
- package/dist/normalization/normalization-factory.js +235 -105
- package/dist/normalization/normalization-factory.js.map +1 -1
- package/dist/normalization/utils.d.ts +7 -3
- package/dist/normalization/utils.js +0 -1
- package/dist/normalization/utils.js.map +1 -1
- package/dist/subgraph/field-configuration.d.ts +7 -0
- package/dist/subgraph/field-configuration.js +3 -0
- package/dist/subgraph/field-configuration.js.map +1 -0
- package/dist/{federation → subgraph}/subgraph.d.ts +1 -1
- package/dist/{federation → subgraph}/subgraph.js +8 -28
- package/dist/subgraph/subgraph.js.map +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/utils/constants.js +8 -1
- package/dist/utils/constants.js.map +1 -1
- package/dist/utils/string-constants.d.ts +1 -0
- package/dist/utils/string-constants.js +2 -1
- package/dist/utils/string-constants.js.map +1 -1
- package/dist/utils/utils.d.ts +22 -1
- package/dist/utils/utils.js +65 -3
- package/dist/utils/utils.js.map +1 -1
- package/package.json +11 -10
- package/dist/federation/subgraph.js.map +0 -1
package/LICENSE
CHANGED
|
@@ -1,18 +1,201 @@
|
|
|
1
|
-
|
|
1
|
+
Apache License
|
|
2
|
+
Version 2.0, January 2004
|
|
3
|
+
http://www.apache.org/licenses/
|
|
2
4
|
|
|
3
|
-
|
|
4
|
-
Licensed Work: "@wundergraph/composition" package. The licensed work is (c) 2023 by WunderGraph, Inc.
|
|
5
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
5
6
|
|
|
6
|
-
|
|
7
|
-
The Limited Testing License (this document, or the "License", or "LTL") is a proprietary, closed-source license.
|
|
7
|
+
1. Definitions.
|
|
8
8
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
You are not permitted to use the Licensed Work in any other way, explicitly not for commercial or production use.
|
|
12
|
-
You may not redistribute or sublicense the Licensed Work, in whole or in part, or create derivative works of the Licensed Work.
|
|
13
|
-
You are not permitted to use the Licensed Work after September 30th, 2023.
|
|
14
|
-
Any use of the Licensed Work in violation of this License will automatically terminate your rights under this License for the current and all other versions of the Licensed Work.
|
|
9
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
10
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
15
11
|
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
12
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
13
|
+
the copyright owner that is granting the License.
|
|
14
|
+
|
|
15
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
16
|
+
other entities that control, are controlled by, or are under common
|
|
17
|
+
control with that entity. For the purposes of this definition,
|
|
18
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
19
|
+
direction or management of such entity, whether by contract or
|
|
20
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
21
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
22
|
+
|
|
23
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
24
|
+
exercising permissions granted by this License.
|
|
25
|
+
|
|
26
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
27
|
+
including but not limited to software source code, documentation
|
|
28
|
+
source, and configuration files.
|
|
29
|
+
|
|
30
|
+
"Object" form shall mean any form resulting from mechanical
|
|
31
|
+
transformation or translation of a Source form, including but
|
|
32
|
+
not limited to compiled object code, generated documentation,
|
|
33
|
+
and conversions to other media types.
|
|
34
|
+
|
|
35
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
36
|
+
Object form, made available under the License, as indicated by a
|
|
37
|
+
copyright notice that is included in or attached to the work
|
|
38
|
+
(an example is provided in the Appendix below).
|
|
39
|
+
|
|
40
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
41
|
+
form, that is based on (or derived from) the Work and for which the
|
|
42
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
43
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
44
|
+
of this License, Derivative Works shall not include works that remain
|
|
45
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
46
|
+
the Work and Derivative Works thereof.
|
|
47
|
+
|
|
48
|
+
"Contribution" shall mean any work of authorship, including
|
|
49
|
+
the original version of the Work and any modifications or additions
|
|
50
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
51
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
52
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
53
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
54
|
+
means any form of electronic, verbal, or written communication sent
|
|
55
|
+
to the Licensor or its representatives, including but not limited to
|
|
56
|
+
communication on electronic mailing lists, source code control systems,
|
|
57
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
58
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
59
|
+
excluding communication that is conspicuously marked or otherwise
|
|
60
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
61
|
+
|
|
62
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
63
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
64
|
+
subsequently incorporated within the Work.
|
|
65
|
+
|
|
66
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
67
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
68
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
69
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
70
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
71
|
+
Work and such Derivative Works in Source or Object form.
|
|
72
|
+
|
|
73
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
74
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
75
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
76
|
+
(except as stated in this section) patent license to make, have made,
|
|
77
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
78
|
+
where such license applies only to those patent claims licensable
|
|
79
|
+
by such Contributor that are necessarily infringed by their
|
|
80
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
81
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
82
|
+
institute patent litigation against any entity (including a
|
|
83
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
84
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
85
|
+
or contributory patent infringement, then any patent licenses
|
|
86
|
+
granted to You under this License for that Work shall terminate
|
|
87
|
+
as of the date such litigation is filed.
|
|
88
|
+
|
|
89
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
90
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
91
|
+
modifications, and in Source or Object form, provided that You
|
|
92
|
+
meet the following conditions:
|
|
93
|
+
|
|
94
|
+
(a) You must give any other recipients of the Work or
|
|
95
|
+
Derivative Works a copy of this License; and
|
|
96
|
+
|
|
97
|
+
(b) You must cause any modified files to carry prominent notices
|
|
98
|
+
stating that You changed the files; and
|
|
99
|
+
|
|
100
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
101
|
+
that You distribute, all copyright, patent, trademark, and
|
|
102
|
+
attribution notices from the Source form of the Work,
|
|
103
|
+
excluding those notices that do not pertain to any part of
|
|
104
|
+
the Derivative Works; and
|
|
105
|
+
|
|
106
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
107
|
+
distribution, then any Derivative Works that You distribute must
|
|
108
|
+
include a readable copy of the attribution notices contained
|
|
109
|
+
within such NOTICE file, excluding those notices that do not
|
|
110
|
+
pertain to any part of the Derivative Works, in at least one
|
|
111
|
+
of the following places: within a NOTICE text file distributed
|
|
112
|
+
as part of the Derivative Works; within the Source form or
|
|
113
|
+
documentation, if provided along with the Derivative Works; or,
|
|
114
|
+
within a display generated by the Derivative Works, if and
|
|
115
|
+
wherever such third-party notices normally appear. The contents
|
|
116
|
+
of the NOTICE file are for informational purposes only and
|
|
117
|
+
do not modify the License. You may add Your own attribution
|
|
118
|
+
notices within Derivative Works that You distribute, alongside
|
|
119
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
120
|
+
that such additional attribution notices cannot be construed
|
|
121
|
+
as modifying the License.
|
|
122
|
+
|
|
123
|
+
You may add Your own copyright statement to Your modifications and
|
|
124
|
+
may provide additional or different license terms and conditions
|
|
125
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
126
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
127
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
128
|
+
the conditions stated in this License.
|
|
129
|
+
|
|
130
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
131
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
132
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
133
|
+
this License, without any additional terms or conditions.
|
|
134
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
135
|
+
the terms of any separate license agreement you may have executed
|
|
136
|
+
with Licensor regarding such Contributions.
|
|
137
|
+
|
|
138
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
139
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
140
|
+
except as required for reasonable and customary use in describing the
|
|
141
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
142
|
+
|
|
143
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
144
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
145
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
146
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
147
|
+
implied, including, without limitation, any warranties or conditions
|
|
148
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
149
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
150
|
+
appropriateness of using or redistributing the Work and assume any
|
|
151
|
+
risks associated with Your exercise of permissions under this License.
|
|
152
|
+
|
|
153
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
154
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
155
|
+
unless required by applicable law (such as deliberate and grossly
|
|
156
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
157
|
+
liable to You for damages, including any direct, indirect, special,
|
|
158
|
+
incidental, or consequential damages of any character arising as a
|
|
159
|
+
result of this License or out of the use or inability to use the
|
|
160
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
161
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
162
|
+
other commercial damages or losses), even if such Contributor
|
|
163
|
+
has been advised of the possibility of such damages.
|
|
164
|
+
|
|
165
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
166
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
167
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
168
|
+
or other liability obligations and/or rights consistent with this
|
|
169
|
+
License. However, in accepting such obligations, You may act only
|
|
170
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
171
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
172
|
+
defend, and hold each Contributor harmless for any liability
|
|
173
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
174
|
+
of your accepting any such warranty or additional liability.
|
|
175
|
+
|
|
176
|
+
END OF TERMS AND CONDITIONS
|
|
177
|
+
|
|
178
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
179
|
+
|
|
180
|
+
To apply the Apache License to your work, attach the following
|
|
181
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
182
|
+
replaced with your own identifying information. (Don't include
|
|
183
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
184
|
+
comment syntax for the file format. We also recommend that a
|
|
185
|
+
file or class name and description of purpose be included on the
|
|
186
|
+
same "printed page" as the copyright notice for easier
|
|
187
|
+
identification within third-party archives.
|
|
188
|
+
|
|
189
|
+
Copyright [yyyy] [name of copyright owner]
|
|
190
|
+
|
|
191
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
192
|
+
you may not use this file except in compliance with the License.
|
|
193
|
+
You may obtain a copy of the License at
|
|
194
|
+
|
|
195
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
196
|
+
|
|
197
|
+
Unless required by applicable law or agreed to in writing, software
|
|
198
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
199
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
200
|
+
See the License for the specific language governing permissions and
|
|
201
|
+
limitations under the License.
|
package/README.md
CHANGED
|
@@ -1,3 +1,142 @@
|
|
|
1
1
|
# WunderGraph Composition
|
|
2
2
|
|
|
3
|
-
The WunderGraph composition library allows to federate multiple subgraph schemas into a
|
|
3
|
+
The WunderGraph composition library allows to federate multiple subgraph schemas into a
|
|
4
|
+
single federated GraphQL schema.
|
|
5
|
+
|
|
6
|
+
### Prerequisites
|
|
7
|
+
|
|
8
|
+
- [Node.js 16 LTS or higher](https://nodejs.dev/en/about/releases/)
|
|
9
|
+
|
|
10
|
+
## Federating subgraphs
|
|
11
|
+
|
|
12
|
+
The `federateSubgraphs` function is responsible for producing a valid federated graph.
|
|
13
|
+
Each subgraph will be normalized and validated before federation.
|
|
14
|
+
This normalization process does not affect the upstream schema.
|
|
15
|
+
The final federated graph will also be validated.
|
|
16
|
+
The function must be provided with an array of at least one [`Subgraph` object](#Subgraph-object).
|
|
17
|
+
An example federation of two simple subgraphs:
|
|
18
|
+
|
|
19
|
+
```typescript
|
|
20
|
+
import { federateSubgraphs, Subgraph } from '@wundergraph.composition';
|
|
21
|
+
import { parse } from 'graphql';
|
|
22
|
+
|
|
23
|
+
const federationResult: FederationResult = federateSubgraphs([subgraphA, subgraphB]);
|
|
24
|
+
|
|
25
|
+
const subgraphA: Subgraph = {
|
|
26
|
+
name: 'subgraph-a',
|
|
27
|
+
url: 'http://localhost:4001',
|
|
28
|
+
definitions: parse(`
|
|
29
|
+
type User @key(fields: "id") {
|
|
30
|
+
id: ID!
|
|
31
|
+
name: String!
|
|
32
|
+
}
|
|
33
|
+
`),
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
const subgraphB: Subgraph = {
|
|
37
|
+
name: 'subgraph-b',
|
|
38
|
+
url: 'http://localhost:4002',
|
|
39
|
+
definitions: parse(`
|
|
40
|
+
type Query {
|
|
41
|
+
users: [User!]!
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
type User @key(fields: "id") {
|
|
45
|
+
id: ID!
|
|
46
|
+
interests: [String!]!
|
|
47
|
+
}
|
|
48
|
+
`),
|
|
49
|
+
};
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
### FederationResult properties
|
|
53
|
+
|
|
54
|
+
The `federateSubgraphs` function returns a `FederationResult` object.
|
|
55
|
+
If federation was successful, the `errors` property will be undefined, and both the `federatedGraphAST` and
|
|
56
|
+
the `federatedGraphSchema` objects will be defined.
|
|
57
|
+
|
|
58
|
+
| property | Description | type |
|
|
59
|
+
|----------------------|-------------------------------------------------|------------------------------------|
|
|
60
|
+
| errors | unique name of the subgraph | Error[] \| undefined |
|
|
61
|
+
| federatedGraphAST | federated schema represented as an AST | graphql.DocumentNode \| undefined |
|
|
62
|
+
| federatedGraphSchema | federated schema represented as a schema object | graphql.GraphQLSchema \| undefined |
|
|
63
|
+
|
|
64
|
+
### Debugging
|
|
65
|
+
|
|
66
|
+
If normalization of any subgraph fails, or the federated graph itself is invalid,
|
|
67
|
+
the AST and schema will not be produced (undefined properties).
|
|
68
|
+
In these cases, the errors array will be defined and populated.
|
|
69
|
+
An example of a simple debugging framework might be:
|
|
70
|
+
|
|
71
|
+
```typescript
|
|
72
|
+
import { federateSubgraphs, Subgraph } from '@wundergraph.composition';
|
|
73
|
+
import { print, printSchema } from 'graphql';
|
|
74
|
+
|
|
75
|
+
const result = federateSubgraphs([subgraphA, subgraphB]);
|
|
76
|
+
if (result.errors) {
|
|
77
|
+
for (const err of result.errors) {
|
|
78
|
+
console.log(err.message);
|
|
79
|
+
}
|
|
80
|
+
} else {
|
|
81
|
+
// Both options to print the federated graph as a string are included for documentational purposes only
|
|
82
|
+
console.log(print(result.federatedGraphAST!)); // log the federated graph AST as a string
|
|
83
|
+
console.log(printSchema(result.federatedGraphSchema!)); // log the federated graph schema as a string
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
// subgraph definitions would be below [removed for brevity]
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
### Errors
|
|
90
|
+
|
|
91
|
+
Errors can happen in three main stages:
|
|
92
|
+
1. While validating the subgraph metadata, e.g., validating that each `Subgraph` object has a unique name.
|
|
93
|
+
2. During the normalization process, which prepares the subgraph for federation.
|
|
94
|
+
(if this stage fails, federation will not be attempted)
|
|
95
|
+
3. During the federation process itself.
|
|
96
|
+
|
|
97
|
+
All errors will be appended to the `FederationResult.errors` array.
|
|
98
|
+
Often, the error message will suggest potential fixes. For instance:
|
|
99
|
+
|
|
100
|
+
`Error: The following root path is unresolvable:
|
|
101
|
+
Query.user.name
|
|
102
|
+
This is because:
|
|
103
|
+
The root type field "Query.user" is defined in the following subgraphs: "subgraph-b".
|
|
104
|
+
However, "User.name" is only defined in the following subgraphs: "subgraph-c".
|
|
105
|
+
Consequently, "User.name" cannot be resolved through the root type field "Query.user".
|
|
106
|
+
Potential solutions:
|
|
107
|
+
Convert "User" into an entity using a "@key" directive.
|
|
108
|
+
Add the shareable root type field "Query.user" to the following subgraphs: "subgraph-c".
|
|
109
|
+
For example (note that V1 fields are shareable by default and do not require a directive):
|
|
110
|
+
type Query {
|
|
111
|
+
...
|
|
112
|
+
user: User @shareable
|
|
113
|
+
}
|
|
114
|
+
`
|
|
115
|
+
|
|
116
|
+
## Subgraph object
|
|
117
|
+
|
|
118
|
+
The `Subgraph` object is the core of the WunderGraph composition library.
|
|
119
|
+
An example is shown below:
|
|
120
|
+
|
|
121
|
+
```typescript
|
|
122
|
+
import { Subgraph } from '@wundergraph/composition'
|
|
123
|
+
import { parse } from 'graphql';
|
|
124
|
+
|
|
125
|
+
const subgraphA: Subgraph = {
|
|
126
|
+
name: 'subgraph-a',
|
|
127
|
+
url: 'http://localhost:4001',
|
|
128
|
+
definitions: parse(`
|
|
129
|
+
type User {
|
|
130
|
+
name: String!
|
|
131
|
+
}
|
|
132
|
+
`),
|
|
133
|
+
};
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
### Subgraph Properties
|
|
137
|
+
|
|
138
|
+
| property | Description | type |
|
|
139
|
+
|-------------|----------------------------------|----------------------|
|
|
140
|
+
| name | unique name of the subgraph | string |
|
|
141
|
+
| url | unique endpoint for the subgraph | string |
|
|
142
|
+
| definitions | SDL of the subgraph | graphql.DocumentNode |
|
package/dist/ast/ast.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { BooleanValueNode, ConstValueNode, DirectiveDefinitionNode, EnumTypeDefinitionNode, EnumValueDefinitionNode, EnumValueNode, FieldDefinitionNode, FloatValueNode, InputObjectTypeDefinitionNode, InputValueDefinitionNode, InterfaceTypeDefinitionNode, IntValueNode, Kind, NamedTypeNode, NameNode, ObjectTypeDefinitionNode, ObjectTypeExtensionNode, ScalarTypeDefinitionNode, StringValueNode, TypeNode, UnionTypeDefinitionNode } from 'graphql';
|
|
2
|
+
import { InterfaceTypeExtensionNode } from 'graphql/index';
|
|
2
3
|
export type ConstValueNodeWithValue = IntValueNode | FloatValueNode | StringValueNode | BooleanValueNode | EnumValueNode;
|
|
3
4
|
export declare function deepCopyTypeNode(node: TypeNode, parentName: string, fieldName: string): TypeNode;
|
|
4
5
|
export type MutableEnumTypeDefinitionNode = {
|
|
@@ -82,3 +83,4 @@ export type MutableUnionTypeDefinitionNode = {
|
|
|
82
83
|
};
|
|
83
84
|
export declare function unionTypeDefinitionNodeToMutable(node: UnionTypeDefinitionNode): MutableUnionTypeDefinitionNode;
|
|
84
85
|
export type MutableTypeDefinitionNode = MutableScalarTypeDefinitionNode | MutableObjectTypeDefinitionNode | MutableInterfaceTypeDefinitionNode | MutableUnionTypeDefinitionNode | MutableEnumTypeDefinitionNode | MutableInputObjectTypeDefinitionNode | DirectiveDefinitionNode;
|
|
86
|
+
export type ObjectLikeTypeDefinitionNode = InterfaceTypeDefinitionNode | InterfaceTypeExtensionNode | ObjectTypeDefinitionNode | ObjectTypeExtensionNode;
|
package/dist/ast/ast.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ast.js","sourceRoot":"","sources":["../../src/ast/ast.ts"],"names":[],"mappings":";;;AAAA,qCAsBiB;AACjB,6CAAqE;
|
|
1
|
+
{"version":3,"file":"ast.js","sourceRoot":"","sources":["../../src/ast/ast.ts"],"names":[],"mappings":";;;AAAA,qCAsBiB;AACjB,6CAAqE;AAGrE,SAAS,2BAA2B,CAClC,IAAsF,EACtF,MAAoC,EAAE,UAA2B;IAEjE,IAAI,IAAI,CAAC,MAAM,EAAE;QACf,KAAK,MAAM,KAAK,IAAI,IAAI,CAAC,MAAM,EAAE;YAC/B,MAAM,CAAC,IAAI,CAAC,4BAA4B,CAAC,KAAK,EAAE,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,kCAAkC;SACtG;KACF;IACD,IAAI,IAAI,CAAC,UAAU,EAAE;QACnB,KAAK,MAAM,IAAI,IAAI,IAAI,CAAC,UAAU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J,CAAC;AAbD,4EAaC"}
|
package/dist/ast/utils.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { FieldDefinitionNode, InterfaceTypeDefinitionNode, InterfaceTypeExtensionNode, Kind, NamedTypeNode, NameNode, ObjectTypeDefinitionNode, ObjectTypeExtensionNode, OperationTypeNode } from 'graphql';
|
|
2
|
-
import { MutableEnumTypeDefinitionNode, MutableEnumValueDefinitionNode, MutableFieldDefinitionNode, MutableInputObjectTypeDefinitionNode, MutableInputValueDefinitionNode, MutableInterfaceTypeDefinitionNode, MutableObjectTypeDefinitionNode, MutableObjectTypeExtensionNode, MutableScalarTypeDefinitionNode, MutableUnionTypeDefinitionNode } from './ast';
|
|
2
|
+
import { MutableEnumTypeDefinitionNode, MutableEnumValueDefinitionNode, MutableFieldDefinitionNode, MutableInputObjectTypeDefinitionNode, MutableInputValueDefinitionNode, MutableInterfaceTypeDefinitionNode, MutableObjectTypeDefinitionNode, MutableObjectTypeExtensionNode, MutableScalarTypeDefinitionNode, MutableUnionTypeDefinitionNode, ObjectLikeTypeDefinitionNode } from './ast';
|
|
3
3
|
export declare enum MergeMethod {
|
|
4
4
|
UNION = 0,
|
|
5
5
|
INTERSECTION = 1,
|
|
@@ -71,7 +71,7 @@ export type ObjectExtensionContainer = {
|
|
|
71
71
|
node: MutableObjectTypeExtensionNode;
|
|
72
72
|
subgraphs: Set<string>;
|
|
73
73
|
};
|
|
74
|
-
export type
|
|
74
|
+
export type RootTypeField = {
|
|
75
75
|
inlineFragment: string;
|
|
76
76
|
path: string;
|
|
77
77
|
name: string;
|
|
@@ -83,7 +83,7 @@ export type OperationField = {
|
|
|
83
83
|
export type PotentiallyUnresolvableField = {
|
|
84
84
|
fieldContainer: FieldContainer;
|
|
85
85
|
fullResolverPaths: string[];
|
|
86
|
-
|
|
86
|
+
rootTypeField: RootTypeField;
|
|
87
87
|
};
|
|
88
88
|
export type ScalarContainer = {
|
|
89
89
|
appearances: number;
|
|
@@ -99,7 +99,8 @@ export type UnionContainer = {
|
|
|
99
99
|
export type ParentContainer = EnumContainer | InputObjectContainer | InterfaceContainer | ObjectContainer | UnionContainer | ScalarContainer;
|
|
100
100
|
export type ExtensionContainer = ObjectExtensionContainer;
|
|
101
101
|
export type ParentMap = Map<string, ParentContainer>;
|
|
102
|
-
export declare function
|
|
102
|
+
export declare function isObjectLikeNodeEntity(node: ObjectLikeTypeDefinitionNode): boolean;
|
|
103
|
+
export declare function isNodeExtension(node: ObjectTypeDefinitionNode | InterfaceTypeDefinitionNode): boolean;
|
|
103
104
|
export declare function extractEntityKeys(node: ObjectTypeDefinitionNode | ObjectTypeExtensionNode, keySet: Set<string>): Set<string>;
|
|
104
105
|
export type EntityKey = {
|
|
105
106
|
nestedKeys?: EntityKey[];
|
|
@@ -116,10 +117,9 @@ export type EntityKeyExtractionResults = {
|
|
|
116
117
|
errors: Error[];
|
|
117
118
|
};
|
|
118
119
|
export declare function getEntityKeyExtractionResults(node: ObjectTypeDefinitionNode | ObjectTypeExtensionNode, entityKeyMap: Map<string, EntityKey>): EntityKeyExtractionResults;
|
|
119
|
-
export declare function extractInterfaces(node: InterfaceTypeDefinitionNode | InterfaceTypeExtensionNode | ObjectTypeDefinitionNode | ObjectTypeExtensionNode, interfaces: Set<string
|
|
120
|
+
export declare function extractInterfaces(node: InterfaceTypeDefinitionNode | InterfaceTypeExtensionNode | ObjectTypeDefinitionNode | ObjectTypeExtensionNode, interfaces: Set<string>, errors?: Error[]): Set<string>;
|
|
120
121
|
export declare function isNodeShareable(node: ObjectTypeDefinitionNode | ObjectTypeExtensionNode | FieldDefinitionNode): boolean;
|
|
121
|
-
export declare function
|
|
122
|
-
export declare function areBaseAndExtensionKindsCompatible(baseKind: Kind, extensionKind: Kind): boolean;
|
|
122
|
+
export declare function areBaseAndExtensionKindsCompatible(baseKind: Kind, extensionKind: Kind, typeName: string): boolean;
|
|
123
123
|
export declare function stringToNameNode(value: string): NameNode;
|
|
124
124
|
export declare function stringToNameNodes(values: string[]): NameNode[];
|
|
125
125
|
export declare function stringToNamedTypeNode(value: string): NamedTypeNode;
|
package/dist/ast/utils.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getInlineFragmentString = exports.isKindAbstract = exports.operationTypeNodeToDefaultType = exports.nodeKindToDirectiveLocation = exports.setToNamedTypeNodeArray = exports.stringToNamedTypeNode = exports.stringToNameNodes = exports.stringToNameNode = exports.areBaseAndExtensionKindsCompatible = exports.
|
|
3
|
+
exports.getInlineFragmentString = exports.isKindAbstract = exports.operationTypeNodeToDefaultType = exports.nodeKindToDirectiveLocation = exports.setToNamedTypeNodeArray = exports.stringToNamedTypeNode = exports.stringToNameNodes = exports.stringToNameNode = exports.areBaseAndExtensionKindsCompatible = exports.isNodeShareable = exports.extractInterfaces = exports.getEntityKeyExtractionResults = exports.getEntityKeyExtractionResult = exports.extractEntityKeys = exports.isNodeExtension = exports.isObjectLikeNodeEntity = exports.MergeMethod = void 0;
|
|
4
4
|
const graphql_1 = require("graphql");
|
|
5
5
|
const string_constants_1 = require("../utils/string-constants");
|
|
6
6
|
const errors_1 = require("../errors/errors");
|
|
@@ -11,8 +11,11 @@ var MergeMethod;
|
|
|
11
11
|
MergeMethod[MergeMethod["INTERSECTION"] = 1] = "INTERSECTION";
|
|
12
12
|
MergeMethod[MergeMethod["CONSISTENT"] = 2] = "CONSISTENT";
|
|
13
13
|
})(MergeMethod || (exports.MergeMethod = MergeMethod = {}));
|
|
14
|
-
function
|
|
15
|
-
|
|
14
|
+
function isObjectLikeNodeEntity(node) {
|
|
15
|
+
// Interface entities are currently unsupported
|
|
16
|
+
if (node.kind === graphql_1.Kind.INTERFACE_TYPE_DEFINITION
|
|
17
|
+
|| node.kind === graphql_1.Kind.INTERFACE_TYPE_EXTENSION
|
|
18
|
+
|| !node.directives?.length) {
|
|
16
19
|
return false;
|
|
17
20
|
}
|
|
18
21
|
for (const directive of node.directives) {
|
|
@@ -22,7 +25,19 @@ function isObjectNodeEntity(node) {
|
|
|
22
25
|
}
|
|
23
26
|
return false;
|
|
24
27
|
}
|
|
25
|
-
exports.
|
|
28
|
+
exports.isObjectLikeNodeEntity = isObjectLikeNodeEntity;
|
|
29
|
+
function isNodeExtension(node) {
|
|
30
|
+
if (!node.directives?.length) {
|
|
31
|
+
return false;
|
|
32
|
+
}
|
|
33
|
+
for (const directive of node.directives) {
|
|
34
|
+
if (directive.name.value === string_constants_1.EXTENDS) {
|
|
35
|
+
return true;
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
return false;
|
|
39
|
+
}
|
|
40
|
+
exports.isNodeExtension = isNodeExtension;
|
|
26
41
|
function extractEntityKeys(node, keySet) {
|
|
27
42
|
if (!node.directives?.length) {
|
|
28
43
|
return keySet;
|
|
@@ -33,7 +48,7 @@ function extractEntityKeys(node, keySet) {
|
|
|
33
48
|
throw new Error('Entity without arguments'); // TODO
|
|
34
49
|
}
|
|
35
50
|
for (const arg of directive.arguments) {
|
|
36
|
-
if (arg.name.value !==
|
|
51
|
+
if (arg.name.value !== string_constants_1.FIELDS) {
|
|
37
52
|
continue;
|
|
38
53
|
}
|
|
39
54
|
if (arg.value.kind !== graphql_1.Kind.STRING) {
|
|
@@ -165,18 +180,23 @@ function getEntityKeyExtractionResults(node, entityKeyMap) {
|
|
|
165
180
|
return { entityKeyMap, errors };
|
|
166
181
|
}
|
|
167
182
|
exports.getEntityKeyExtractionResults = getEntityKeyExtractionResults;
|
|
168
|
-
function extractInterfaces(node, interfaces) {
|
|
183
|
+
function extractInterfaces(node, interfaces, errors) {
|
|
169
184
|
if (!node.interfaces) {
|
|
170
185
|
return interfaces;
|
|
171
186
|
}
|
|
187
|
+
const parentTypeName = node.name.value;
|
|
172
188
|
for (const face of node.interfaces) {
|
|
173
|
-
|
|
189
|
+
const name = face.name.value;
|
|
190
|
+
if (errors && interfaces.has(name)) {
|
|
191
|
+
errors.push((0, errors_1.duplicateInterfaceError)(name, parentTypeName));
|
|
192
|
+
continue;
|
|
193
|
+
}
|
|
194
|
+
interfaces.add(name);
|
|
174
195
|
}
|
|
175
196
|
return interfaces;
|
|
176
197
|
}
|
|
177
198
|
exports.extractInterfaces = extractInterfaces;
|
|
178
199
|
function isNodeShareable(node) {
|
|
179
|
-
// TODO make sure extensions do not break this https://www.apollographql.com/docs/federation/federated-types/sharing-types/#using-shareable-with-extend
|
|
180
200
|
if (!node.directives) {
|
|
181
201
|
return false;
|
|
182
202
|
}
|
|
@@ -188,13 +208,7 @@ function isNodeShareable(node) {
|
|
|
188
208
|
return false;
|
|
189
209
|
}
|
|
190
210
|
exports.isNodeShareable = isNodeShareable;
|
|
191
|
-
function
|
|
192
|
-
if (kind !== other) {
|
|
193
|
-
throw new Error(''); // TODO
|
|
194
|
-
}
|
|
195
|
-
}
|
|
196
|
-
exports.assertEqualKindsOrThrow = assertEqualKindsOrThrow;
|
|
197
|
-
function areBaseAndExtensionKindsCompatible(baseKind, extensionKind) {
|
|
211
|
+
function areBaseAndExtensionKindsCompatible(baseKind, extensionKind, typeName) {
|
|
198
212
|
switch (baseKind) {
|
|
199
213
|
case graphql_1.Kind.ENUM_TYPE_DEFINITION:
|
|
200
214
|
return extensionKind === graphql_1.Kind.ENUM_TYPE_EXTENSION;
|
|
@@ -209,7 +223,7 @@ function areBaseAndExtensionKindsCompatible(baseKind, extensionKind) {
|
|
|
209
223
|
case graphql_1.Kind.UNION_TYPE_DEFINITION:
|
|
210
224
|
return extensionKind === graphql_1.Kind.UNION_TYPE_EXTENSION;
|
|
211
225
|
default:
|
|
212
|
-
throw
|
|
226
|
+
throw (0, errors_1.unexpectedKindFatalError)(typeName);
|
|
213
227
|
}
|
|
214
228
|
}
|
|
215
229
|
exports.areBaseAndExtensionKindsCompatible = areBaseAndExtensionKindsCompatible;
|
package/dist/ast/utils.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../src/ast/utils.ts"],"names":[],"mappings":";;;AAAA,qCAUiB;
|
|
1
|
+
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../src/ast/utils.ts"],"names":[],"mappings":";;;AAAA,qCAUiB;AAcjB,gEAgBmC;AACnC,6CAa0B;AAC1B,0CAAiD;AAEjD,IAAY,WAIX;AAJD,WAAY,WAAW;IACrB,+CAAK,CAAA;IACL,6DAAY,CAAA;IACZ,yDAAU,CAAA;AACZ,CAAC,EAJW,WAAW,2BAAX,WAAW,QAItB;AA0HD,SAAgB,sBAAsB,CAAC,IAAkC;IACvE,+CAA+C;IAC/C,IAAI,IAAI,CAAC,IAAI,KAAK,cAAI,CAAC,yBAAyB;WAC3C,IAAI,CAAC,IAAI,KAAK,cAAI,CAAC,wBAAwB;WAC3C,CAAC,IAAI,CAAC,UAAU,EAAE,MAAM,EAAE;QAC7B,OAAO,KAAK,CAAC;KACd;IACD,KAAK,MAAM,SAAS,IAAI,IAAI,CAAC,UAAU,EAAE;QACvC,IAAI,SAAS,CAAC,IAAI,CAAC,KAAK,KAAK,sBAAG,EAAE;YAChC,OAAO,IAAI,CAAC;SACb;KACF;IACD,OAAO,KAAK,CAAC;AACf,CAAC;AAbD,wDAaC;AAED,SAAgB,eAAe,CAAC,IAA4D;IAC1F,IAAI,CAAC,IAAI,CAAC,UAAU,EAAE,MAAM,EAAE;QAC5B,OAAO,KAAK,CAAC;KACd;IACD,KAAK,MAAM,SAAS,IAAI,IAAI,CAAC,UAAU,EAAE;QACvC,IAAI,SAAS,CAAC,IAAI,CAAC,KAAK,KAAK,0BAAO,EAAE;YACpC,OAAO,IAAI,CAAC;SACb;KACF;IACD,OAAO,KAAK,CAAC;AACf,CAAC;AAVD,0CAUC;AAED,SAAgB,iBAAiB,CAC/B,IAAwD,EACxD,MAAmB;IAEnB,IAAI,CAAC,IAAI,CAAC,UAAU,EAAE,MAAM,EAAE;QAC5B,OAAO,MAAM,CAAC;KACf;IACD,KAAK,MAA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AArCD,kEAqCC;AAEY,QAAA,8BAA8B,GAAG,IAAI,GAAG,CAA4B;IAC/E,CAAC,2BAAiB,CAAC,QAAQ,EAAE,2BAAQ,CAAC;IACtC,CAAC,2BAAiB,CAAC,KAAK,EAAE,wBAAK,CAAC;IAChC,CAAC,2BAAiB,CAAC,YAAY,EAAE,+BAAY,CAAC;CAC/C,CAAC,CAAC;AAEH,SAAgB,cAAc,CAAC,IAAU;IACvC,OAAO,IAAI,KAAK,cAAI,CAAC,yBAAyB,IAAI,IAAI,KAAK,cAAI,CAAC,qBAAqB,CAAC;AACxF,CAAC;AAFD,wCAEC;AAED,SAAgB,uBAAuB,CAAC,cAAsB;IAC5D,OAAO,WAAW,cAAc,GAAG,CAAC;AACtC,CAAC;AAFD,0DAEC"}
|
package/dist/errors/errors.d.ts
CHANGED
|
@@ -1,17 +1,20 @@
|
|
|
1
|
-
import { ObjectContainer,
|
|
2
|
-
import { ConstDirectiveNode, Kind, OperationTypeNode, SchemaExtensionNode, TypeExtensionNode } from 'graphql';
|
|
1
|
+
import { ObjectContainer, RootTypeField } from '../ast/utils';
|
|
2
|
+
import { ConstDirectiveNode, Kind, OperationTypeNode, SchemaExtensionNode, TypeDefinitionNode, TypeExtensionNode } from 'graphql';
|
|
3
|
+
import { ImplementationErrorsMap } from '../utils/utils';
|
|
3
4
|
export declare const minimumSubgraphRequirementError: Error;
|
|
5
|
+
export declare function incompatibleExtensionError(typeName: string, baseKind: Kind, extensionKind: Kind): Error;
|
|
4
6
|
export declare function incompatibleArgumentTypesError(argName: string, parentName: string, childName: string, expectedType: string, actualType: string): Error;
|
|
5
7
|
export declare function incompatibleChildTypesError(parentName: string, childName: string, expectedType: string, actualType: string): Error;
|
|
6
8
|
export declare function incompatibleArgumentDefaultValueError(argName: string, parentName: string, childName: string, expectedValue: string | boolean, actualValue: string | boolean): Error;
|
|
7
9
|
export declare function incompatibleArgumentDefaultValueTypeError(argName: string, parentName: string, childName: string, expectedType: Kind, actualType: Kind): Error;
|
|
8
10
|
export declare function incompatibleSharedEnumError(parentName: string): Error;
|
|
9
|
-
export declare function incompatibleExtensionKindsError(node: TypeExtensionNode | SchemaExtensionNode, existingKind: Kind): Error;
|
|
11
|
+
export declare function incompatibleExtensionKindsError(node: TypeDefinitionNode | TypeExtensionNode | SchemaExtensionNode, existingKind: Kind): Error;
|
|
10
12
|
export declare function invalidSubgraphNamesError(names: string[], invalidNameErrorMessages: string[]): Error;
|
|
11
13
|
export declare function duplicateFieldDefinitionError(fieldName: string, typeName: string): Error;
|
|
12
14
|
export declare function duplicateDirectiveDefinitionError(directiveName: string): Error;
|
|
13
15
|
export declare function duplicateEnumValueDefinitionError(valueName: string, typeName: string): Error;
|
|
14
16
|
export declare function duplicateFieldExtensionError(typeName: string, childName: string): Error;
|
|
17
|
+
export declare function duplicateInterfaceExtensionError(interfaceName: string, typeName: string): Error;
|
|
15
18
|
export declare function duplicateInterfaceError(interfaceName: string, typeName: string): Error;
|
|
16
19
|
export declare function duplicateUnionMemberError(memberName: string, typeName: string): Error;
|
|
17
20
|
export declare function duplicateValueExtensionError(parentType: string, typeName: string, childName: string): Error;
|
|
@@ -23,7 +26,7 @@ export declare function operationDefinitionError(typeName: string, operationType
|
|
|
23
26
|
export declare function shareableFieldDefinitionsError(parent: ObjectContainer, children: Set<string>): Error;
|
|
24
27
|
export declare function undefinedDirectiveError(directiveName: string, hostPath: string): Error;
|
|
25
28
|
export declare function undefinedEntityKeyErrorMessage(fieldName: string, objectName: string): string;
|
|
26
|
-
export declare function unresolvableFieldError(
|
|
29
|
+
export declare function unresolvableFieldError(rootTypeField: RootTypeField, fieldName: string, unresolvablePaths: string[], fieldSubgraphs: string, parentTypeName: string): Error;
|
|
27
30
|
export declare function undefinedTypeError(typeName: string): Error;
|
|
28
31
|
export declare const federationUnexpectedNodeKindError: (parentName: string, fieldName: string) => Error;
|
|
29
32
|
export declare const federationInvalidParentTypeError: (parentName: string, fieldName: string) => Error;
|
|
@@ -58,3 +61,4 @@ export declare function invalidSubgraphNameErrorMessage(index: number, newName:
|
|
|
58
61
|
export declare function invalidOperationTypeDefinitionError(existingOperationType: OperationTypeNode, typeName: string, newOperationType: OperationTypeNode): Error;
|
|
59
62
|
export declare function invalidRootTypeDefinitionError(operationType: OperationTypeNode, typeName: string, defaultTypeName: string): Error;
|
|
60
63
|
export declare function subgraphInvalidSyntaxError(error: Error): Error;
|
|
64
|
+
export declare function unimplementedInterfaceFieldsError(parentTypeName: string, parentTypeString: string, implementationErrorsMap: ImplementationErrorsMap): Error;
|