@apollo/federation-internals 2.4.5 → 2.4.7

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.
@@ -1,41 +0,0 @@
1
- import { DirectiveLocation } from "graphql";
2
- import "../definitions";
3
- import { createDirectiveSpecification } from "../directiveAndTypeSpecification";
4
- import { ARGUMENT_COMPOSITION_STRATEGIES } from "../argumentCompositionStrategies";
5
- import { TAG_VERSIONS } from "../tagSpec";
6
-
7
- const supergraphSpecification = () => TAG_VERSIONS.latest();
8
-
9
- test('must have supergraph link if composed', () => {
10
- expect(() => createDirectiveSpecification({
11
- name: 'foo',
12
- locations: [DirectiveLocation.OBJECT],
13
- composes: true,
14
- })).toThrow('Should provide a @link specification to use in supergraph for directive @foo if it composes');
15
- });
16
-
17
- test('must have a merge strategy on all arguments if any', () => {
18
- expect(() => createDirectiveSpecification({
19
- name: 'foo',
20
- locations: [DirectiveLocation.OBJECT],
21
- composes: true,
22
- supergraphSpecification,
23
- args: [
24
- { name: "v1", type: (schema) => schema.intType(), compositionStrategy: ARGUMENT_COMPOSITION_STRATEGIES.MAX },
25
- { name: "v2", type: (schema) => schema.intType() }
26
- ],
27
- })).toThrow('Invalid directive specification for @foo: not all arguments define a composition strategy');
28
- });
29
-
30
- test('must be not be repeatable if it has a merge strategy', () => {
31
- expect(() => createDirectiveSpecification({
32
- name: 'foo',
33
- locations: [DirectiveLocation.OBJECT],
34
- composes: true,
35
- repeatable: true,
36
- supergraphSpecification,
37
- args: [
38
- { name: "v", type: (schema) => schema.intType(), compositionStrategy: ARGUMENT_COMPOSITION_STRATEGIES.MAX },
39
- ],
40
- })).toThrow('Invalid directive specification for @foo: @foo is repeatable and should not define composition strategy for its arguments');
41
- });