@theguild/federation-composition 0.4.0 → 0.5.0-alpha-20231213200549-5807b77
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/README.md +1 -1
- package/cjs/specifications/federation.js +70 -0
- package/cjs/subgraph/validation/rules/elements/authenticated.js +21 -0
- package/cjs/subgraph/validation/rules/elements/policy.js +21 -0
- package/cjs/subgraph/validation/rules/elements/requires-scopes.js +21 -0
- package/cjs/subgraph/validation/validate-subgraph.js +6 -0
- package/esm/specifications/federation.js +70 -0
- package/esm/subgraph/validation/rules/elements/authenticated.js +17 -0
- package/esm/subgraph/validation/rules/elements/policy.js +17 -0
- package/esm/subgraph/validation/rules/elements/requires-scopes.js +17 -0
- package/esm/subgraph/validation/validate-subgraph.js +6 -0
- package/package.json +1 -1
- package/typings/specifications/federation.d.cts +13 -1
- package/typings/specifications/federation.d.ts +13 -1
- package/typings/subgraph/validation/rules/elements/authenticated.d.cts +4 -0
- package/typings/subgraph/validation/rules/elements/authenticated.d.ts +4 -0
- package/typings/subgraph/validation/rules/elements/policy.d.cts +4 -0
- package/typings/subgraph/validation/rules/elements/policy.d.ts +4 -0
- package/typings/subgraph/validation/rules/elements/requires-scopes.d.cts +4 -0
- package/typings/subgraph/validation/rules/elements/requires-scopes.d.ts +4 -0
package/README.md
CHANGED
|
@@ -119,6 +119,76 @@ const federationSpecFactory = {
|
|
|
119
119
|
) repeatable on FIELD_DEFINITION | INTERFACE | OBJECT | UNION | ARGUMENT_DEFINITION | SCALAR | ENUM | ENUM_VALUE | INPUT_OBJECT | INPUT_FIELD_DEFINITION
|
|
120
120
|
scalar FieldSet
|
|
121
121
|
`, prefix, imports),
|
|
122
|
+
'v2.4': (prefix, imports) => createTypeDefinitions(`
|
|
123
|
+
directive @composeDirective(name: String!) repeatable on SCHEMA
|
|
124
|
+
directive @extends on OBJECT | INTERFACE
|
|
125
|
+
directive @external on OBJECT | FIELD_DEFINITION
|
|
126
|
+
directive @key(
|
|
127
|
+
fields: FieldSet!
|
|
128
|
+
resolvable: Boolean = true
|
|
129
|
+
) repeatable on OBJECT | INTERFACE
|
|
130
|
+
directive @inaccessible on FIELD_DEFINITION | OBJECT | INTERFACE | UNION | ENUM | ENUM_VALUE | SCALAR | INPUT_OBJECT | INPUT_FIELD_DEFINITION | ARGUMENT_DEFINITION
|
|
131
|
+
directive @interfaceObject on OBJECT
|
|
132
|
+
directive @override(from: String!) on FIELD_DEFINITION
|
|
133
|
+
directive @provides(fields: FieldSet!) on FIELD_DEFINITION
|
|
134
|
+
directive @requires(fields: FieldSet!) on FIELD_DEFINITION
|
|
135
|
+
directive @shareable repeatable on FIELD_DEFINITION | OBJECT
|
|
136
|
+
directive @tag(
|
|
137
|
+
name: String!
|
|
138
|
+
) repeatable on FIELD_DEFINITION | INTERFACE | OBJECT | UNION | ARGUMENT_DEFINITION | SCALAR | ENUM | ENUM_VALUE | INPUT_OBJECT | INPUT_FIELD_DEFINITION
|
|
139
|
+
scalar FieldSet
|
|
140
|
+
`, prefix, imports),
|
|
141
|
+
'v2.5': (prefix, imports) => createTypeDefinitions(`
|
|
142
|
+
directive @authenticated on FIELD_DEFINITION | OBJECT | INTERFACE | SCALAR | ENUM
|
|
143
|
+
directive @requiresScopes(
|
|
144
|
+
scopes: [[Scope!]!]!
|
|
145
|
+
) on FIELD_DEFINITION | OBJECT | INTERFACE | SCALAR | ENUM
|
|
146
|
+
directive @composeDirective(name: String!) repeatable on SCHEMA
|
|
147
|
+
directive @extends on OBJECT | INTERFACE
|
|
148
|
+
directive @external on OBJECT | FIELD_DEFINITION
|
|
149
|
+
directive @key(
|
|
150
|
+
fields: FieldSet!
|
|
151
|
+
resolvable: Boolean = true
|
|
152
|
+
) repeatable on OBJECT | INTERFACE
|
|
153
|
+
directive @inaccessible on FIELD_DEFINITION | OBJECT | INTERFACE | UNION | ENUM | ENUM_VALUE | SCALAR | INPUT_OBJECT | INPUT_FIELD_DEFINITION | ARGUMENT_DEFINITION
|
|
154
|
+
directive @interfaceObject on OBJECT
|
|
155
|
+
directive @override(from: String!) on FIELD_DEFINITION
|
|
156
|
+
directive @provides(fields: FieldSet!) on FIELD_DEFINITION
|
|
157
|
+
directive @requires(fields: FieldSet!) on FIELD_DEFINITION
|
|
158
|
+
directive @shareable repeatable on FIELD_DEFINITION | OBJECT
|
|
159
|
+
directive @tag(
|
|
160
|
+
name: String!
|
|
161
|
+
) repeatable on FIELD_DEFINITION | INTERFACE | OBJECT | UNION | ARGUMENT_DEFINITION | SCALAR | ENUM | ENUM_VALUE | INPUT_OBJECT | INPUT_FIELD_DEFINITION
|
|
162
|
+
scalar FieldSet
|
|
163
|
+
scalar Scope
|
|
164
|
+
`, prefix, imports),
|
|
165
|
+
'v2.6': (prefix, imports) => createTypeDefinitions(`
|
|
166
|
+
directive @policy(
|
|
167
|
+
policies: [[federation__Policy!]!]!
|
|
168
|
+
) on FIELD_DEFINITION | OBJECT | INTERFACE | SCALAR | ENUM
|
|
169
|
+
directive @authenticated on FIELD_DEFINITION | OBJECT | INTERFACE | SCALAR | ENUM
|
|
170
|
+
directive @requiresScopes(
|
|
171
|
+
scopes: [[Scope!]!]!
|
|
172
|
+
) on FIELD_DEFINITION | OBJECT | INTERFACE | SCALAR | ENUM
|
|
173
|
+
directive @composeDirective(name: String!) repeatable on SCHEMA
|
|
174
|
+
directive @extends on OBJECT | INTERFACE
|
|
175
|
+
directive @external on OBJECT | FIELD_DEFINITION
|
|
176
|
+
directive @key(
|
|
177
|
+
fields: FieldSet!
|
|
178
|
+
resolvable: Boolean = true
|
|
179
|
+
) repeatable on OBJECT | INTERFACE
|
|
180
|
+
directive @inaccessible on FIELD_DEFINITION | OBJECT | INTERFACE | UNION | ENUM | ENUM_VALUE | SCALAR | INPUT_OBJECT | INPUT_FIELD_DEFINITION | ARGUMENT_DEFINITION
|
|
181
|
+
directive @interfaceObject on OBJECT
|
|
182
|
+
directive @override(from: String!) on FIELD_DEFINITION
|
|
183
|
+
directive @provides(fields: FieldSet!) on FIELD_DEFINITION
|
|
184
|
+
directive @requires(fields: FieldSet!) on FIELD_DEFINITION
|
|
185
|
+
directive @shareable repeatable on FIELD_DEFINITION | OBJECT
|
|
186
|
+
directive @tag(
|
|
187
|
+
name: String!
|
|
188
|
+
) repeatable on FIELD_DEFINITION | INTERFACE | OBJECT | UNION | ARGUMENT_DEFINITION | SCALAR | ENUM | ENUM_VALUE | INPUT_OBJECT | INPUT_FIELD_DEFINITION
|
|
189
|
+
scalar FieldSet
|
|
190
|
+
scalar Policy
|
|
191
|
+
`, prefix, imports),
|
|
122
192
|
};
|
|
123
193
|
function createTypeDefinitions(doc, prefix, imports) {
|
|
124
194
|
const shouldFilter = !!imports;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.AuthenticatedRule = void 0;
|
|
4
|
+
const graphql_1 = require("graphql");
|
|
5
|
+
const helpers_js_1 = require("../../../helpers.js");
|
|
6
|
+
function AuthenticatedRule(context) {
|
|
7
|
+
return {
|
|
8
|
+
DirectiveDefinition(node) {
|
|
9
|
+
(0, helpers_js_1.validateDirectiveAgainstOriginal)(node, 'authenticated', context);
|
|
10
|
+
},
|
|
11
|
+
Directive(node) {
|
|
12
|
+
if (!context.isAvailableFederationDirective('authenticated', node)) {
|
|
13
|
+
return;
|
|
14
|
+
}
|
|
15
|
+
context.reportError(new graphql_1.GraphQLError(`@authenticated is not yet supported`, {
|
|
16
|
+
extensions: { code: 'UNSUPPORTED_FEATURE' },
|
|
17
|
+
}));
|
|
18
|
+
},
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
exports.AuthenticatedRule = AuthenticatedRule;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.PolicyRule = void 0;
|
|
4
|
+
const graphql_1 = require("graphql");
|
|
5
|
+
const helpers_js_1 = require("../../../helpers.js");
|
|
6
|
+
function PolicyRule(context) {
|
|
7
|
+
return {
|
|
8
|
+
DirectiveDefinition(node) {
|
|
9
|
+
(0, helpers_js_1.validateDirectiveAgainstOriginal)(node, 'policy', context);
|
|
10
|
+
},
|
|
11
|
+
Directive(node) {
|
|
12
|
+
if (!context.isAvailableFederationDirective('policy', node)) {
|
|
13
|
+
return;
|
|
14
|
+
}
|
|
15
|
+
context.reportError(new graphql_1.GraphQLError(`@policy is not yet supported`, {
|
|
16
|
+
extensions: { code: 'UNSUPPORTED_FEATURE' },
|
|
17
|
+
}));
|
|
18
|
+
},
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
exports.PolicyRule = PolicyRule;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.RequiresScopesRule = void 0;
|
|
4
|
+
const graphql_1 = require("graphql");
|
|
5
|
+
const helpers_js_1 = require("../../../helpers.js");
|
|
6
|
+
function RequiresScopesRule(context) {
|
|
7
|
+
return {
|
|
8
|
+
DirectiveDefinition(node) {
|
|
9
|
+
(0, helpers_js_1.validateDirectiveAgainstOriginal)(node, 'requiresScopes', context);
|
|
10
|
+
},
|
|
11
|
+
Directive(node) {
|
|
12
|
+
if (!context.isAvailableFederationDirective('requiresScopes', node)) {
|
|
13
|
+
return;
|
|
14
|
+
}
|
|
15
|
+
context.reportError(new graphql_1.GraphQLError(`@requiresScopes is not yet supported`, {
|
|
16
|
+
extensions: { code: 'UNSUPPORTED_FEATURE' },
|
|
17
|
+
}));
|
|
18
|
+
},
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
exports.RequiresScopesRule = RequiresScopesRule;
|
|
@@ -5,6 +5,7 @@ const graphql_1 = require("graphql");
|
|
|
5
5
|
const type_node_info_js_1 = require("../../graphql/type-node-info.js");
|
|
6
6
|
const federation_js_1 = require("../../specifications/federation.js");
|
|
7
7
|
const link_js_1 = require("../../specifications/link.js");
|
|
8
|
+
const authenticated_js_1 = require("./rules/elements/authenticated.js");
|
|
8
9
|
const compose_directive_js_1 = require("./rules/elements/compose-directive.js");
|
|
9
10
|
const extends_js_1 = require("./rules/elements/extends.js");
|
|
10
11
|
const external_js_1 = require("./rules/elements/external.js");
|
|
@@ -13,7 +14,9 @@ const inaccessible_js_1 = require("./rules/elements/inaccessible.js");
|
|
|
13
14
|
const interface_object_js_1 = require("./rules/elements/interface-object.js");
|
|
14
15
|
const key_js_1 = require("./rules/elements/key.js");
|
|
15
16
|
const override_js_1 = require("./rules/elements/override.js");
|
|
17
|
+
const policy_js_1 = require("./rules/elements/policy.js");
|
|
16
18
|
const provides_js_1 = require("./rules/elements/provides.js");
|
|
19
|
+
const requires_scopes_js_1 = require("./rules/elements/requires-scopes.js");
|
|
17
20
|
const requires_js_1 = require("./rules/elements/requires.js");
|
|
18
21
|
const shareable_js_1 = require("./rules/elements/shareable.js");
|
|
19
22
|
const tag_js_1 = require("./rules/elements/tag.js");
|
|
@@ -68,6 +71,9 @@ function validateSubgraph(subgraph, stateBuilder, federation, __internal) {
|
|
|
68
71
|
field_set_js_1.FieldSetRules,
|
|
69
72
|
inaccessible_js_1.InaccessibleRules,
|
|
70
73
|
interface_object_js_1.InterfaceObjectRules,
|
|
74
|
+
authenticated_js_1.AuthenticatedRule,
|
|
75
|
+
policy_js_1.PolicyRule,
|
|
76
|
+
requires_scopes_js_1.RequiresScopesRule,
|
|
71
77
|
override_js_1.OverrideRules,
|
|
72
78
|
extends_js_1.ExtendsRules,
|
|
73
79
|
query_root_type_inaccessible_rule_js_1.QueryRootTypeInaccessibleRule,
|
|
@@ -114,6 +114,76 @@ const federationSpecFactory = {
|
|
|
114
114
|
) repeatable on FIELD_DEFINITION | INTERFACE | OBJECT | UNION | ARGUMENT_DEFINITION | SCALAR | ENUM | ENUM_VALUE | INPUT_OBJECT | INPUT_FIELD_DEFINITION
|
|
115
115
|
scalar FieldSet
|
|
116
116
|
`, prefix, imports),
|
|
117
|
+
'v2.4': (prefix, imports) => createTypeDefinitions(`
|
|
118
|
+
directive @composeDirective(name: String!) repeatable on SCHEMA
|
|
119
|
+
directive @extends on OBJECT | INTERFACE
|
|
120
|
+
directive @external on OBJECT | FIELD_DEFINITION
|
|
121
|
+
directive @key(
|
|
122
|
+
fields: FieldSet!
|
|
123
|
+
resolvable: Boolean = true
|
|
124
|
+
) repeatable on OBJECT | INTERFACE
|
|
125
|
+
directive @inaccessible on FIELD_DEFINITION | OBJECT | INTERFACE | UNION | ENUM | ENUM_VALUE | SCALAR | INPUT_OBJECT | INPUT_FIELD_DEFINITION | ARGUMENT_DEFINITION
|
|
126
|
+
directive @interfaceObject on OBJECT
|
|
127
|
+
directive @override(from: String!) on FIELD_DEFINITION
|
|
128
|
+
directive @provides(fields: FieldSet!) on FIELD_DEFINITION
|
|
129
|
+
directive @requires(fields: FieldSet!) on FIELD_DEFINITION
|
|
130
|
+
directive @shareable repeatable on FIELD_DEFINITION | OBJECT
|
|
131
|
+
directive @tag(
|
|
132
|
+
name: String!
|
|
133
|
+
) repeatable on FIELD_DEFINITION | INTERFACE | OBJECT | UNION | ARGUMENT_DEFINITION | SCALAR | ENUM | ENUM_VALUE | INPUT_OBJECT | INPUT_FIELD_DEFINITION
|
|
134
|
+
scalar FieldSet
|
|
135
|
+
`, prefix, imports),
|
|
136
|
+
'v2.5': (prefix, imports) => createTypeDefinitions(`
|
|
137
|
+
directive @authenticated on FIELD_DEFINITION | OBJECT | INTERFACE | SCALAR | ENUM
|
|
138
|
+
directive @requiresScopes(
|
|
139
|
+
scopes: [[Scope!]!]!
|
|
140
|
+
) on FIELD_DEFINITION | OBJECT | INTERFACE | SCALAR | ENUM
|
|
141
|
+
directive @composeDirective(name: String!) repeatable on SCHEMA
|
|
142
|
+
directive @extends on OBJECT | INTERFACE
|
|
143
|
+
directive @external on OBJECT | FIELD_DEFINITION
|
|
144
|
+
directive @key(
|
|
145
|
+
fields: FieldSet!
|
|
146
|
+
resolvable: Boolean = true
|
|
147
|
+
) repeatable on OBJECT | INTERFACE
|
|
148
|
+
directive @inaccessible on FIELD_DEFINITION | OBJECT | INTERFACE | UNION | ENUM | ENUM_VALUE | SCALAR | INPUT_OBJECT | INPUT_FIELD_DEFINITION | ARGUMENT_DEFINITION
|
|
149
|
+
directive @interfaceObject on OBJECT
|
|
150
|
+
directive @override(from: String!) on FIELD_DEFINITION
|
|
151
|
+
directive @provides(fields: FieldSet!) on FIELD_DEFINITION
|
|
152
|
+
directive @requires(fields: FieldSet!) on FIELD_DEFINITION
|
|
153
|
+
directive @shareable repeatable on FIELD_DEFINITION | OBJECT
|
|
154
|
+
directive @tag(
|
|
155
|
+
name: String!
|
|
156
|
+
) repeatable on FIELD_DEFINITION | INTERFACE | OBJECT | UNION | ARGUMENT_DEFINITION | SCALAR | ENUM | ENUM_VALUE | INPUT_OBJECT | INPUT_FIELD_DEFINITION
|
|
157
|
+
scalar FieldSet
|
|
158
|
+
scalar Scope
|
|
159
|
+
`, prefix, imports),
|
|
160
|
+
'v2.6': (prefix, imports) => createTypeDefinitions(`
|
|
161
|
+
directive @policy(
|
|
162
|
+
policies: [[federation__Policy!]!]!
|
|
163
|
+
) on FIELD_DEFINITION | OBJECT | INTERFACE | SCALAR | ENUM
|
|
164
|
+
directive @authenticated on FIELD_DEFINITION | OBJECT | INTERFACE | SCALAR | ENUM
|
|
165
|
+
directive @requiresScopes(
|
|
166
|
+
scopes: [[Scope!]!]!
|
|
167
|
+
) on FIELD_DEFINITION | OBJECT | INTERFACE | SCALAR | ENUM
|
|
168
|
+
directive @composeDirective(name: String!) repeatable on SCHEMA
|
|
169
|
+
directive @extends on OBJECT | INTERFACE
|
|
170
|
+
directive @external on OBJECT | FIELD_DEFINITION
|
|
171
|
+
directive @key(
|
|
172
|
+
fields: FieldSet!
|
|
173
|
+
resolvable: Boolean = true
|
|
174
|
+
) repeatable on OBJECT | INTERFACE
|
|
175
|
+
directive @inaccessible on FIELD_DEFINITION | OBJECT | INTERFACE | UNION | ENUM | ENUM_VALUE | SCALAR | INPUT_OBJECT | INPUT_FIELD_DEFINITION | ARGUMENT_DEFINITION
|
|
176
|
+
directive @interfaceObject on OBJECT
|
|
177
|
+
directive @override(from: String!) on FIELD_DEFINITION
|
|
178
|
+
directive @provides(fields: FieldSet!) on FIELD_DEFINITION
|
|
179
|
+
directive @requires(fields: FieldSet!) on FIELD_DEFINITION
|
|
180
|
+
directive @shareable repeatable on FIELD_DEFINITION | OBJECT
|
|
181
|
+
directive @tag(
|
|
182
|
+
name: String!
|
|
183
|
+
) repeatable on FIELD_DEFINITION | INTERFACE | OBJECT | UNION | ARGUMENT_DEFINITION | SCALAR | ENUM | ENUM_VALUE | INPUT_OBJECT | INPUT_FIELD_DEFINITION
|
|
184
|
+
scalar FieldSet
|
|
185
|
+
scalar Policy
|
|
186
|
+
`, prefix, imports),
|
|
117
187
|
};
|
|
118
188
|
function createTypeDefinitions(doc, prefix, imports) {
|
|
119
189
|
const shouldFilter = !!imports;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { GraphQLError } from 'graphql';
|
|
2
|
+
import { validateDirectiveAgainstOriginal } from '../../../helpers.js';
|
|
3
|
+
export function AuthenticatedRule(context) {
|
|
4
|
+
return {
|
|
5
|
+
DirectiveDefinition(node) {
|
|
6
|
+
validateDirectiveAgainstOriginal(node, 'authenticated', context);
|
|
7
|
+
},
|
|
8
|
+
Directive(node) {
|
|
9
|
+
if (!context.isAvailableFederationDirective('authenticated', node)) {
|
|
10
|
+
return;
|
|
11
|
+
}
|
|
12
|
+
context.reportError(new GraphQLError(`@authenticated is not yet supported`, {
|
|
13
|
+
extensions: { code: 'UNSUPPORTED_FEATURE' },
|
|
14
|
+
}));
|
|
15
|
+
},
|
|
16
|
+
};
|
|
17
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { GraphQLError } from 'graphql';
|
|
2
|
+
import { validateDirectiveAgainstOriginal } from '../../../helpers.js';
|
|
3
|
+
export function PolicyRule(context) {
|
|
4
|
+
return {
|
|
5
|
+
DirectiveDefinition(node) {
|
|
6
|
+
validateDirectiveAgainstOriginal(node, 'policy', context);
|
|
7
|
+
},
|
|
8
|
+
Directive(node) {
|
|
9
|
+
if (!context.isAvailableFederationDirective('policy', node)) {
|
|
10
|
+
return;
|
|
11
|
+
}
|
|
12
|
+
context.reportError(new GraphQLError(`@policy is not yet supported`, {
|
|
13
|
+
extensions: { code: 'UNSUPPORTED_FEATURE' },
|
|
14
|
+
}));
|
|
15
|
+
},
|
|
16
|
+
};
|
|
17
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { GraphQLError } from 'graphql';
|
|
2
|
+
import { validateDirectiveAgainstOriginal } from '../../../helpers.js';
|
|
3
|
+
export function RequiresScopesRule(context) {
|
|
4
|
+
return {
|
|
5
|
+
DirectiveDefinition(node) {
|
|
6
|
+
validateDirectiveAgainstOriginal(node, 'requiresScopes', context);
|
|
7
|
+
},
|
|
8
|
+
Directive(node) {
|
|
9
|
+
if (!context.isAvailableFederationDirective('requiresScopes', node)) {
|
|
10
|
+
return;
|
|
11
|
+
}
|
|
12
|
+
context.reportError(new GraphQLError(`@requiresScopes is not yet supported`, {
|
|
13
|
+
extensions: { code: 'UNSUPPORTED_FEATURE' },
|
|
14
|
+
}));
|
|
15
|
+
},
|
|
16
|
+
};
|
|
17
|
+
}
|
|
@@ -2,6 +2,7 @@ import { concatAST, GraphQLError, Kind, parse, visit, visitInParallel, } from 'g
|
|
|
2
2
|
import { TypeNodeInfo, visitWithTypeNodeInfo } from '../../graphql/type-node-info.js';
|
|
3
3
|
import { createSpecSchema } from '../../specifications/federation.js';
|
|
4
4
|
import { parseLinkDirective } from '../../specifications/link.js';
|
|
5
|
+
import { AuthenticatedRule } from './rules/elements/authenticated.js';
|
|
5
6
|
import { ComposeDirectiveRules } from './rules/elements/compose-directive.js';
|
|
6
7
|
import { ExtendsRules } from './rules/elements/extends.js';
|
|
7
8
|
import { ExternalRules } from './rules/elements/external.js';
|
|
@@ -10,7 +11,9 @@ import { InaccessibleRules } from './rules/elements/inaccessible.js';
|
|
|
10
11
|
import { InterfaceObjectRules } from './rules/elements/interface-object.js';
|
|
11
12
|
import { KeyRules } from './rules/elements/key.js';
|
|
12
13
|
import { OverrideRules } from './rules/elements/override.js';
|
|
14
|
+
import { PolicyRule } from './rules/elements/policy.js';
|
|
13
15
|
import { ProvidesRules } from './rules/elements/provides.js';
|
|
16
|
+
import { RequiresScopesRule } from './rules/elements/requires-scopes.js';
|
|
14
17
|
import { RequiresRules } from './rules/elements/requires.js';
|
|
15
18
|
import { ShareableRules } from './rules/elements/shareable.js';
|
|
16
19
|
import { TagRules } from './rules/elements/tag.js';
|
|
@@ -63,6 +66,9 @@ export function validateSubgraph(subgraph, stateBuilder, federation, __internal)
|
|
|
63
66
|
FieldSetRules,
|
|
64
67
|
InaccessibleRules,
|
|
65
68
|
InterfaceObjectRules,
|
|
69
|
+
AuthenticatedRule,
|
|
70
|
+
PolicyRule,
|
|
71
|
+
RequiresScopesRule,
|
|
66
72
|
OverrideRules,
|
|
67
73
|
ExtendsRules,
|
|
68
74
|
QueryRootTypeInaccessibleRule,
|
package/package.json
CHANGED
|
@@ -27,10 +27,22 @@ declare const federationSpecFactory: {
|
|
|
27
27
|
directives: DirectiveDefinitionNode[];
|
|
28
28
|
types: TypeDefinitionNode[];
|
|
29
29
|
};
|
|
30
|
+
'v2.4': (prefix: string, imports?: readonly LinkImport[]) => {
|
|
31
|
+
directives: DirectiveDefinitionNode[];
|
|
32
|
+
types: TypeDefinitionNode[];
|
|
33
|
+
};
|
|
34
|
+
'v2.5': (prefix: string, imports?: readonly LinkImport[]) => {
|
|
35
|
+
directives: DirectiveDefinitionNode[];
|
|
36
|
+
types: TypeDefinitionNode[];
|
|
37
|
+
};
|
|
38
|
+
'v2.6': (prefix: string, imports?: readonly LinkImport[]) => {
|
|
39
|
+
directives: DirectiveDefinitionNode[];
|
|
40
|
+
types: TypeDefinitionNode[];
|
|
41
|
+
};
|
|
30
42
|
};
|
|
31
43
|
export declare function isFederationLink(link: Link): boolean;
|
|
32
44
|
export declare function detectFederationVersion(typeDefs: DocumentNode): {
|
|
33
|
-
version: "v1.0" | "v2.0" | "v2.1" | "v2.2" | "v2.3";
|
|
45
|
+
version: "v1.0" | "v2.0" | "v2.1" | "v2.2" | "v2.3" | "v2.4" | "v2.5" | "v2.6";
|
|
34
46
|
imports: ({
|
|
35
47
|
readonly kind: "type" | "directive";
|
|
36
48
|
readonly name: string;
|
|
@@ -27,10 +27,22 @@ declare const federationSpecFactory: {
|
|
|
27
27
|
directives: DirectiveDefinitionNode[];
|
|
28
28
|
types: TypeDefinitionNode[];
|
|
29
29
|
};
|
|
30
|
+
'v2.4': (prefix: string, imports?: readonly LinkImport[]) => {
|
|
31
|
+
directives: DirectiveDefinitionNode[];
|
|
32
|
+
types: TypeDefinitionNode[];
|
|
33
|
+
};
|
|
34
|
+
'v2.5': (prefix: string, imports?: readonly LinkImport[]) => {
|
|
35
|
+
directives: DirectiveDefinitionNode[];
|
|
36
|
+
types: TypeDefinitionNode[];
|
|
37
|
+
};
|
|
38
|
+
'v2.6': (prefix: string, imports?: readonly LinkImport[]) => {
|
|
39
|
+
directives: DirectiveDefinitionNode[];
|
|
40
|
+
types: TypeDefinitionNode[];
|
|
41
|
+
};
|
|
30
42
|
};
|
|
31
43
|
export declare function isFederationLink(link: Link): boolean;
|
|
32
44
|
export declare function detectFederationVersion(typeDefs: DocumentNode): {
|
|
33
|
-
version: "v1.0" | "v2.0" | "v2.1" | "v2.2" | "v2.3";
|
|
45
|
+
version: "v1.0" | "v2.0" | "v2.1" | "v2.2" | "v2.3" | "v2.4" | "v2.5" | "v2.6";
|
|
34
46
|
imports: ({
|
|
35
47
|
readonly kind: "type" | "directive";
|
|
36
48
|
readonly name: string;
|