@apollo/federation-internals 2.4.5 → 2.4.6

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/src/operations.ts CHANGED
@@ -46,6 +46,7 @@ import {
46
46
  isLeafType,
47
47
  Variables,
48
48
  isObjectType,
49
+ NamedType,
49
50
  } from "./definitions";
50
51
  import { isInterfaceObjectType } from "./federation";
51
52
  import { ERRORS } from "./error";
@@ -152,7 +153,11 @@ export class Field<TArgs extends {[key: string]: any} = {[key: string]: any}> ex
152
153
  }
153
154
 
154
155
  isLeafField(): boolean {
155
- return isLeafType(baseType(this.definition.type!));
156
+ return isLeafType(this.baseType());
157
+ }
158
+
159
+ baseType(): NamedType {
160
+ return baseType(this.definition.type!);
156
161
  }
157
162
 
158
163
  withUpdatedDefinition(newDefinition: FieldDefinition<any>): Field<TArgs> {
@@ -674,7 +679,7 @@ export function concatOperationPaths(head: OperationPath, tail: OperationPath):
674
679
 
675
680
  function isUselessFollowupElement(first: OperationElement, followup: OperationElement, conditionals: Directive<any, any>[]): boolean {
676
681
  const typeOfFirst = first.kind === 'Field'
677
- ? baseType(first.definition.type!)
682
+ ? first.baseType()
678
683
  : first.typeCondition;
679
684
 
680
685
  // The followup is useless if it's a fragment (with no directives we would want to preserve) whose type
@@ -1042,7 +1047,6 @@ export class NamedFragments {
1042
1047
  dependsOn: string[],
1043
1048
  };
1044
1049
  const fragmentsMap = new Map<string, FragmentInfo>();
1045
-
1046
1050
  const removedFragments = new Set<string>();
1047
1051
  for (const fragment of this.definitions()) {
1048
1052
  const mappedSelectionSet = mapper(fragment.selectionSet.expandAllFragments().trimUnsatisfiableBranches(fragment.typeCondition));
@@ -1430,7 +1434,73 @@ export class SelectionSet {
1430
1434
  for (const selection of selections) {
1431
1435
  mergedSubselections.add(selection.selectionSet!);
1432
1436
  }
1433
- return first.withUpdatedSelectionSet(mergedSubselections.toSelectionSet(first.selectionSet.parentType));
1437
+
1438
+ // We know all the `selections` are basically for the same element (same field or same inline fragment),
1439
+ // and we want to return a single selection with the merged selections. There is a subtlety regarding
1440
+ // the parent type of that merged selection however: we cannot safely rely on the parent type of any
1441
+ // of the individual selections, because this can be incorrect. Let's illustrate.
1442
+ // Consider that we have:
1443
+ // ```graphql
1444
+ // type Query {
1445
+ // a: A!
1446
+ // }
1447
+ //
1448
+ // interface IA1 {
1449
+ // b: IB1!
1450
+ // }
1451
+ //
1452
+ // interface IA2 {
1453
+ // b: IB2!
1454
+ // }
1455
+ //
1456
+ // type A implements IA1 & IA2 {
1457
+ // b: B!
1458
+ // }
1459
+ //
1460
+ // interface IB1 {
1461
+ // v1: Int!
1462
+ // }
1463
+ //
1464
+ // interface IB2 {
1465
+ // v2: Int!
1466
+ // }
1467
+ //
1468
+ // type B implements IB1 & IB2 {
1469
+ // v1: Int!
1470
+ // v2: Int!
1471
+ // }
1472
+ // ```
1473
+ // and suppose that we're trying to check if selection set:
1474
+ // maybeSuperset = { ... on IA1 { b { v1 } } ... on IA2 { b { v2 } } } // (parent type A)
1475
+ // contains selection set:
1476
+ // maybeSubset = { b { v1 v2 } } // (parent type A)
1477
+ //
1478
+ // In that case, the `contains` method below will call this function with the 2 sub-selections
1479
+ // from `maybeSuperset`, but with the unecessary interface fragment removed (reminder that the
1480
+ // parent type is `A`, so the "casts" into the interfaces are semantically useless).
1481
+ //
1482
+ // And so in that case, the argument to this method will be:
1483
+ // [ b { v1 } (parent type IA1), b { v2 } (parent type IA2) ]
1484
+ // but then, the sub-selection `{ v1 }` of the 1st value will have parent type IB1,
1485
+ // and the sub-selection `{ v2 }` of the 2nd value will have parent type IB2,
1486
+ // neither of which work for the merge sub-selection.
1487
+ //
1488
+ // Instead, we want to use as parent type the type of field `b` the parent type of `this`
1489
+ // (which is `maybeSupeset` in our example). Which means that we want to use type `B` for
1490
+ // the sub-selection, which is now guaranteed to work (or `maybeSupergerset` wouldn't have
1491
+ // been valid).
1492
+ //
1493
+ // Long story short, we get that type by rebasing any of the selection element (we use the
1494
+ // first as we have it) on `this.parentType`, which gives use the element we want, and we
1495
+ // use the type of that for the sub-selection.
1496
+
1497
+ if (first.kind === 'FieldSelection') {
1498
+ const rebasedField = first.element.rebaseOn(this.parentType);
1499
+ return new FieldSelection(rebasedField, mergedSubselections.toSelectionSet(rebasedField.baseType() as CompositeType));
1500
+ } else {
1501
+ const rebasedFragment = first.element.rebaseOn(this.parentType);
1502
+ return new InlineFragmentSelection(rebasedFragment, mergedSubselections.toSelectionSet(rebasedFragment.castedType()));
1503
+ }
1434
1504
  }
1435
1505
 
1436
1506
  contains(that: SelectionSet): boolean {
@@ -1456,6 +1526,28 @@ export class SelectionSet {
1456
1526
  // validate this (`canApplyAtType` is not free, and we want to avoid repeating it multiple times).
1457
1527
  diffWithNamedFragmentIfContained(candidate: NamedFragmentDefinition, parentType: CompositeType): { contains: boolean, diff?: SelectionSet } {
1458
1528
  const that = candidate.selectionSetAtType(parentType);
1529
+ // It's possible that while the fragment technically applies at `parentType`, it's "rebasing" on
1530
+ // `parentType` is empty, or contains only `__typename`. For instance, suppose we have
1531
+ // a union `U = A | B | C`, and then a fragment:
1532
+ // ```graphql
1533
+ // fragment F on U {
1534
+ // ... on A {
1535
+ // x
1536
+ // }
1537
+ // ... on b {
1538
+ // y
1539
+ // }
1540
+ // }
1541
+ // ```
1542
+ // It is then possible to apply `F` when the parent type is `C`, but this ends up selecting
1543
+ // nothing at all.
1544
+ //
1545
+ // Returning `contains: true` in those cases is, while not 100% incorrect, at least not productive,
1546
+ // and so we skip right away in that case. This is essentially an optimisation.
1547
+ if (that.isEmpty() || (that.selections().length === 1 && that.selections()[0].isTypenameField())) {
1548
+ return { contains: false };
1549
+ }
1550
+
1459
1551
  if (this.contains(that)) {
1460
1552
  // One subtlety here is that at "this" sub-selections may already have been optimized with some fragments. It's
1461
1553
  // usually ok because `candidate` will also use those fragments, but one fragments that `candidate` can never be
@@ -1483,6 +1575,17 @@ export class SelectionSet {
1483
1575
  const otherSelections = that.triviallyNestedSelectionsForKey(this.parentType, key);
1484
1576
  const allSelections = thatSelection ? [thatSelection].concat(otherSelections) : otherSelections;
1485
1577
  if (allSelections.length === 0) {
1578
+ // If it is a fragment spread, and we didn't find it in `that`, then we try to expand that
1579
+ // fragment and see if that result is entirely covered by `that`. If that is the case, then it means
1580
+ // `thisSelection` does not need to be in the returned "diff". If it's not entirely covered,
1581
+ // we just add the spread itself to the diff: even if some parts of it were covered by `that`,
1582
+ // keeping just the fragment is, in a sense, more condensed.
1583
+ if (thisSelection instanceof FragmentSpreadSelection) {
1584
+ const expanded = thisSelection.selectionSet.expandAllFragments().trimUnsatisfiableBranches(this.parentType);
1585
+ if (expanded.minus(that).isEmpty()) {
1586
+ continue;
1587
+ }
1588
+ }
1486
1589
  updated.add(thisSelection);
1487
1590
  } else {
1488
1591
  const selectionDiff = allSelections.reduce<Selection | undefined>((prev, val) => prev?.minus(val), thisSelection);
@@ -1790,7 +1893,7 @@ function makeSelection(parentType: CompositeType, updates: SelectionUpdate[], fr
1790
1893
  }
1791
1894
 
1792
1895
  const element = updateElement(first).rebaseOn(parentType);
1793
- const subSelectionParentType = element.kind === 'Field' ? baseType(element.definition.type!) : element.castedType();
1896
+ const subSelectionParentType = element.kind === 'Field' ? element.baseType() : element.castedType();
1794
1897
  if (!isCompositeType(subSelectionParentType)) {
1795
1898
  // This is a leaf, so all updates should correspond ot the same field and we just use the first.
1796
1899
  return selectionOfElement(element);
@@ -1984,6 +2087,11 @@ abstract class AbstractSelection<TElement extends OperationElement, TIsLeaf exte
1984
2087
  return this.element.parentType;
1985
2088
  }
1986
2089
 
2090
+ isTypenameField(): boolean {
2091
+ // Overridden where appropriate
2092
+ return false;
2093
+ }
2094
+
1987
2095
  collectVariables(collector: VariableCollector) {
1988
2096
  this.element.collectVariables(collector);
1989
2097
  this.selectionSet?.collectVariables(collector)
@@ -2110,6 +2218,10 @@ export class FieldSelection extends AbstractSelection<Field<any>, undefined, Fie
2110
2218
  return this;
2111
2219
  }
2112
2220
 
2221
+ isTypenameField(): boolean {
2222
+ return this.element.definition.name === typenameFieldName;
2223
+ }
2224
+
2113
2225
  withUpdatedComponents(field: Field<any>, selectionSet: SelectionSet | undefined): FieldSelection {
2114
2226
  return new FieldSelection(field, selectionSet);
2115
2227
  }
@@ -2120,7 +2232,7 @@ export class FieldSelection extends AbstractSelection<Field<any>, undefined, Fie
2120
2232
 
2121
2233
  optimize(fragments: NamedFragments): Selection {
2122
2234
  let optimizedSelection = this.selectionSet ? this.selectionSet.optimizeSelections(fragments) : undefined;
2123
- const fieldBaseType = baseType(this.element.definition.type!);
2235
+ const fieldBaseType = this.element.baseType();
2124
2236
  if (isCompositeType(fieldBaseType) && optimizedSelection) {
2125
2237
  const optimized = this.tryOptimizeSubselectionWithFragments({
2126
2238
  parentType: fieldBaseType,
@@ -2213,7 +2325,7 @@ export class FieldSelection extends AbstractSelection<Field<any>, undefined, Fie
2213
2325
  return this.withUpdatedElement(rebasedElement);
2214
2326
  }
2215
2327
 
2216
- const rebasedBase = baseType(rebasedElement.definition.type!);
2328
+ const rebasedBase = rebasedElement.baseType();
2217
2329
  if (rebasedBase === this.selectionSet.parentType) {
2218
2330
  return this.withUpdatedElement(rebasedElement);
2219
2331
  }
@@ -2279,7 +2391,7 @@ export class FieldSelection extends AbstractSelection<Field<any>, undefined, Fie
2279
2391
  return this;
2280
2392
  }
2281
2393
 
2282
- const base = baseType(this.element.definition.type!)
2394
+ const base = this.element.baseType()
2283
2395
  assert(isCompositeType(base), () => `Field ${this.element} should not have a sub-selection`);
2284
2396
  const trimmed = (options?.recursive ?? true) ? this.mapToSelectionSet((s) => s.trimUnsatisfiableBranches(base)) : this;
2285
2397
  // In rare caes, it's possible that everything in the sub-selection was trimmed away and so the
@@ -2385,7 +2497,6 @@ export abstract class FragmentSelection extends AbstractSelection<FragmentElemen
2385
2497
  || (isObjectType(parentType) && possibleRuntimeTypes(this.element.typeCondition).some((t) => t.name === parentType.name))
2386
2498
  );
2387
2499
  }
2388
-
2389
2500
  }
2390
2501
 
2391
2502
  class InlineFragmentSelection extends FragmentSelection {
@@ -2597,7 +2708,7 @@ class InlineFragmentSelection extends FragmentSelection {
2597
2708
  if (isObjectType(thisCondition) || !possibleRuntimeTypes(thisCondition).includes(currentType)) {
2598
2709
  return undefined;
2599
2710
  } else {
2600
- const trimmed =this.selectionSet.trimUnsatisfiableBranches(currentType, options);
2711
+ const trimmed = this.selectionSet.trimUnsatisfiableBranches(currentType, options);
2601
2712
  return trimmed.isEmpty() ? undefined : trimmed;
2602
2713
  }
2603
2714
  }
@@ -2728,8 +2839,10 @@ class FragmentSpreadSelection extends FragmentSelection {
2728
2839
  assert(false, `Unsupported`);
2729
2840
  }
2730
2841
 
2731
- trimUnsatisfiableBranches(_: CompositeType): FragmentSelection {
2732
- return this;
2842
+ trimUnsatisfiableBranches(parentType: CompositeType): FragmentSelection {
2843
+ // We must update the spread parent type if necessary since we're not going deeper,
2844
+ // or we'll be fundamentally losing context.
2845
+ return this.rebaseOn(parentType);
2733
2846
  }
2734
2847
 
2735
2848
  namedFragments(): NamedFragments | undefined {
@@ -2766,18 +2879,30 @@ class FragmentSpreadSelection extends FragmentSelection {
2766
2879
  return this;
2767
2880
  }
2768
2881
 
2769
- rebaseOn(_parentType: CompositeType): FragmentSelection {
2770
- // This is a little bit iffy, because the fragment could link to a schema (typically the supergraph API one)
2771
- // that is different from the one of `_selectionSet` (say, a subgraph fetch selection in which we're trying to
2772
- // reuse a user fragment). But in practice, we expand all fragments when we do query planning and only re-add
2773
- // fragments back at the very end, so this should be fine. Importantly, we don't want this method to mistakenly
2774
- // expand the spread, as that would compromise the code that optimize subgraph fetches to re-use named
2882
+ rebaseOn(parentType: CompositeType): FragmentSelection {
2883
+ // We preserve the parent type here, to make sure we don't lose context, but we actually don't
2884
+ // want to expand the spread as that would compromise the code that optimize subgraph fetches to re-use named
2775
2885
  // fragments.
2776
- return this;
2886
+ //
2887
+ // This is a little bit iffy, because the fragment may not apply at this parent type, but we
2888
+ // currently leave it to the caller to ensure this is not a mistake. But most of the
2889
+ // QP code works on selections with fully expanded fragments, so this code (and that of `canAddTo`
2890
+ // on come into play in the code for reusing fragments, and that code calls those methods
2891
+ // appropriately.
2892
+ if (this.parentType === parentType) {
2893
+ return this;
2894
+ }
2895
+ return new FragmentSpreadSelection(
2896
+ parentType,
2897
+ this.fragments,
2898
+ this.namedFragment,
2899
+ this.spreadDirectives,
2900
+ );
2777
2901
  }
2778
2902
 
2779
2903
  canAddTo(_: CompositeType): boolean {
2780
- // Mimicking the logic of `rebaseOn`.
2904
+ // Since `rebaseOn` never fail, we copy the logic here and always return `true`. But as
2905
+ // mentioned in `rebaseOn`, this leave it a bit to the caller to know what he is doing.
2781
2906
  return true;
2782
2907
  }
2783
2908
 
package/src/utils.ts CHANGED
@@ -401,7 +401,7 @@ export function printHumanReadableList(
401
401
  }
402
402
 
403
403
  export type Concrete<Type> = {
404
- [Property in keyof Type]-?: Type[Property];
404
+ [Property in keyof Type]-?: Concrete<Type[Property]>;
405
405
  };
406
406
 
407
407
  // for use with Array.filter
package/CHANGELOG.md DELETED
@@ -1,211 +0,0 @@
1
- # CHANGELOG for `@apollo/federation-internals`
2
-
3
- ## 2.4.5
4
- ### Patch Changes
5
-
6
-
7
- - Supersedes v2.4.4 due to a publishing error with no dist/ folder ([#2583](https://github.com/apollographql/federation/pull/2583))
8
-
9
- ## 2.4.4
10
-
11
- ## 2.4.3
12
- ### Patch Changes
13
-
14
-
15
- - Improves the heuristics used to try to reuse the query named fragments in subgraph fetches. Said fragment will be reused ([#2541](https://github.com/apollographql/federation/pull/2541))
16
- more often, which can lead to smaller subgraph queries (and hence overall faster processing).
17
-
18
- ## 2.4.2
19
- ### Patch Changes
20
-
21
-
22
- - Allow passing print options to the `compose` method to impact how the supergraph is printed, and adds new printing ([#2042](https://github.com/apollographql/federation/pull/2042))
23
- options to order all elements of the schema.
24
-
25
- - Fix potential bug when an `@interfaceObject` type has a `@requires`. When an `@interfaceObject` type has a field with a ([#2524](https://github.com/apollographql/federation/pull/2524))
26
- `@requires` and the query requests that field only for some specific implementations of the corresponding interface,
27
- then the generated query plan was sometimes invalid and could result in an invalid query to a subgraph (against a
28
- subgraph that rely on `@apollo/subgraph`, this lead the subgraph to produce an error message looking like `"The
29
- _entities resolver tried to load an entity for type X, but no object or interface type of that name was found in the
30
- schema"`).
31
-
32
- ## 2.4.1
33
- ### Patch Changes
34
-
35
-
36
- - Fix issues (incorrectly rejected composition and/or subgraph errors) with `@interfaceObject`. Those issues may occur ([#2494](https://github.com/apollographql/federation/pull/2494))
37
- either due to some use of `@requires` in an `@interfaceObject` type, or when some subgraph `S` defines a type that is an
38
- implementation of an interface `I` in the supergraph, and there is an `@interfaceObject` for `I` in another subgraph,
39
- but `S` does not itself defines `I`.
40
-
41
- - Fix assertion error during query planning in some cases where queries has some unsatisfiable branches (a part of the ([#2486](https://github.com/apollographql/federation/pull/2486))
42
- query goes through type conditions that no runtime types satisfies).
43
-
44
- - Start building packages with TS 5.x, which should have no effect on consumers ([#2480](https://github.com/apollographql/federation/pull/2480))
45
-
46
-
47
- - Improves reuse of named fragments in subgraph fetches. When a question has named fragments, the code tries to reuse ([#2497](https://github.com/apollographql/federation/pull/2497))
48
- those fragment in subgraph fetches is those can apply (so when the fragment is fully queried in a single subgraph fetch).
49
- However, the existing was only able to reuse those fragment in a small subset of cases. This change makes it much more
50
- likely that _if_ a fragment can be reused, it will be.
51
-
52
- ## 2.4.0
53
- ### Patch Changes
54
-
55
-
56
- - Refactor the internal implementation of selection sets used by the query planner to decrease the code complexity and ([#2387](https://github.com/apollographql/federation/pull/2387))
57
- improve query plan generation performance in many cases.
58
-
59
- - Revert #2293. Removing URL import causes a problem when running under deno. ([#2451](https://github.com/apollographql/federation/pull/2451))
60
-
61
-
62
- - Use globally available URL object instead of node builtin "url" module ([#2293](https://github.com/apollographql/federation/pull/2293))
63
-
64
-
65
- - Optimises query plan generation for parts of queries that can statically be known to not cross across subgraphs ([#2449](https://github.com/apollographql/federation/pull/2449))
66
-
67
- ## 2.4.0-alpha.1
68
- ### Patch Changes
69
-
70
-
71
- - Revert #2293. Removing URL import causes a problem when running under deno. ([#2451](https://github.com/apollographql/federation/pull/2451))
72
-
73
- ## 2.4.0-alpha.0
74
- ### Patch Changes
75
-
76
-
77
- - Handle defaulted variables correctly during post-processing. ([#2443](https://github.com/apollographql/federation/pull/2443))
78
-
79
- Users who tried to use built-in conditional directives (skip/include) with _defaulted_ variables and no variable provided would encounter an error thrown by operation post-processing saying that the variables weren't provided. The defaulted values went unaccounted for, so the operation would validate but then fail an assertion while resolving the conditional.
80
-
81
- With this change, defaulted variable values are now collected and provided to post-processing (with defaults being overwritten by variables that are actually provided).
82
-
83
-
84
- ## 2.3.5
85
-
86
- ## 2.3.4
87
- ### Patch Changes
88
-
89
- - Use globally available URL object instead of node builtin "url" module ([#2293](https://github.com/apollographql/federation/pull/2293))
90
-
91
- ## 2.3.3
92
-
93
- ## 2.3.2
94
-
95
- ## 2.3.1
96
-
97
- ## 2.3.0
98
-
99
- - Fix incorrect handling of `@external` on a type when dealing when adding `@shareable` during fed1 schema upgrades [PR #2343](https://github.com/apollographql/federation/pull/2343).
100
-
101
- ## 2.2.1
102
-
103
- - Fix federation spec always being expanded to the last version [PR #2274](https://github.com/apollographql/federation/pull/2274).
104
-
105
- ## 2.2.0
106
-
107
- - Preserve default values of input object fields [PR #2218](https://github.com/apollographql/federation/pull/2218).
108
- - Provide support for marking @external on object type [PR #2214](https://github.com/apollographql/federation/pull/2214)
109
- - Drop support for node12 [PR #2202](https://github.com/apollographql/federation/pull/2202)
110
- - Correctly reject field names starting with `__` [PR #2237](https://github.com/apollographql/federation/pull/2237).
111
- - Preserve default values of input object fields [PR #2218](https://github.com/apollographql/federation/pull/2218).
112
-
113
- ## 2.1.4
114
-
115
- - Ensures supergraph `@defer`/`@stream` definitions of supergraph are not included in the API schema [PR #2212](https://github.com/apollographql/federation/pull/2212).
116
- - Fix validation of variable on input field not taking default into account [PR #2176](https://github.com/apollographql/federation/pull/2176).
117
-
118
- ## 2.1.0
119
-
120
- - Update peer dependency `graphql` to `^16.5.0` to use `GraphQLErrorOptions` [PR #2060](https://github.com/apollographql/federation/pull/2060)
121
- - Don't require `@link` when using `@composeDirective` [PR #2046](https://github.com/apollographql/federation/pull/2046)
122
- - Add `@defer` support [PR #1958](https://github.com/apollographql/federation/pull/1958)
123
- - Add `@composeDirective` directive to specify directives that should be merged to the supergraph during composition [PR #1996](https://github.com/apollographql/federation/pull/1996).
124
- - Expand support for Node.js v18 [PR #1884](https://github.com/apollographql/federation/pull/1884)
125
-
126
- ## 2.0.4
127
-
128
- - Fix issue when all root operations were defined in an `extend schema` [PR #1875](https://github.com/apollographql/federation/issues/1875).
129
-
130
- ## 2.0.3
131
-
132
- - Fix bug with type extension of empty type definition [PR #1821](https://github.com/apollographql/federation/pull/1821)
133
-
134
- ## 2.0.2
135
-
136
- - Fix bug removing an enum type [PR #1813](https://github.com/apollographql/federation/pull/1813)
137
- - Fix `Schema.clone` when directive application happens before definition [PR #1785](https://github.com/apollographql/federation/pull/1785)
138
- - More helpful error message for errors encountered while reading supergraphs generated pre-federation 2 [PR #1796](https://github.com/apollographql/federation/pull/1796)
139
- - Fix bug applying an imported federation directive on another directive definition [PR #1797](https://github.com/apollographql/federation/pull/1797).
140
- - Prevent non-core-feature elements from being marked @inaccessible if referenced by core feature elements [PR #1769](https://github.com/apollographql/federation/pull/1769)
141
- - Improve fed1 schema support during composition [PR #1735](https://github.com/apollographql/federation/pull/1735)
142
- - Honor directive imports when directive name is spec name [PR #1720](https://github.com/apollographql/federation/pull/1720)
143
-
144
- ## v2.0.1
145
-
146
- - Use `for: SECURITY` in the core/link directive application in the supergraph for `@inaccessible` [PR #1715](https://github.com/apollographql/federation/pull/1715)
147
-
148
- ## v2.0.0
149
-
150
- - Previous preview release promoted to general availability! Please see previous changelog entries for full info.
151
-
152
- ## v2.0.0-preview.14
153
-
154
- - Implement `buildSubgraphSchema` using federation internals [PR #1697](https://github.com/apollographql/federation/pull/1697)
155
-
156
-
157
- ## v2.0.0-preview.11
158
-
159
- - Add support for `@inaccessible` v0.2 [PR #1678](https://github.com/apollographql/federation/pull/1678)
160
- - Add a level to hints, uppercase their code and related fixes [PR #1683](https://github.com/apollographql/federation/pull/1683).
161
-
162
- ## v2.0.0-preview.9
163
-
164
- - Adds Support for `@tag/v0.2`, which allows the `@tag` directive to be additionally placed on arguments, scalars, enums, enum values, input objects, and input object fields. [PR #1652](https://github.com/apollographql/federation/pull/1652).
165
- - Add missing `includeDeprecated` argument for `args` and `inputFields` when defining introspection fields [PR #1584](https://github.com/apollographql/federation/pull/1584)
166
- - Adds support for the `@override` directive on fields to indicate that a field should be moved from one subgraph to another. [PR #1484](https://github.com/apollographql/federation/pull/1484)
167
-
168
- ## v2.0.0-preview.5
169
-
170
- - Fix propagation of `@tag` to the supergraph and allows @tag to be repeated. Additionally, merged directives (only `@tag` and `@deprecated` currently) are not allowed on external fields anymore [PR #1592](https://github.com/apollographql/federation/pull/1592).
171
-
172
- ## v2.0.0-preview.4
173
-
174
- - Make error messages more actionable when constructing subgraphs from a supergraph [PR #1586](https://github.com/apollographql/federation/pull/1586)
175
-
176
- ## v2.0.0-preview.3
177
-
178
- - Fix issue that created type extensions with descriptions, which is invalid graphQL syntax [PR #1582](https://github.com/apollographql/federation/pull/1582).
179
-
180
- ## v2.0.0-preview.2
181
-
182
- - Re-publishing release which published to npm with stale build artifacts from `version-0.x` release.
183
-
184
- ## v2.0.0-preview.1
185
-
186
- - No-op publish to account for publishing difficulties.
187
-
188
- ## v2.0.0-preview.0
189
-
190
- - Initial "preview" release.
191
-
192
- ## v2.0.0-alpha.6
193
-
194
- - Avoid incomplete subgraphs when extracting them from the supergraph. [PR #1511](https://github.com/apollographql/federation/pull/1511)
195
-
196
- ## v2.0.0-alpha.5
197
-
198
- - Remove `graphql@15` from peer dependencies [PR #1472](https://github.com/apollographql/federation/pull/1472).
199
-
200
- ## v2.0.0-alpha.3
201
-
202
- - Assign and document error codes for all errors [PR #1274](https://github.com/apollographql/federation/pull/1274).
203
- - Fix issue reading some 0.x generated supergraphs [PR #1351](https://github.com/apollographql/federation/pull/1351).
204
-
205
- ## v2.0.0-alpha.2
206
-
207
- - __BREAKING__: Bump graphql peer dependency to `^15.7.0` [PR #1200](https://github.com/apollographql/federation/pull/1200)
208
-
209
- ## v2.0.0-alpha.1
210
-
211
- - :tada: Initial alpha release of Federation 2.0. For more information, see our [documentation](https://www.apollographql.com/docs/federation/v2/). We look forward to your feedback!
package/jest.config.js DELETED
@@ -1,11 +0,0 @@
1
- const baseConfig = require('../jest.config.base');
2
-
3
- /** @typedef {import('ts-jest/dist/types')} */
4
- /** @type {import('@jest/types').Config.InitialOptions} */
5
- module.exports = {
6
- ...baseConfig,
7
- displayName: {
8
- name: '@apollo/federation-internals',
9
- color: 'magenta'
10
- }
11
- };