CHANGELOG for @apollo/composition
2.9.1
Patch Changes
-
Fix bugs in composition when merging nulls in directive applications and when handling renames. (#3134)
-
Updated dependencies [
b8e4ab5352a4dfd262af49493fdd42e86e5e3d99
,e6c05b6c96023aa3dec79889431f8217fcb3806d
]:- @apollo/[email protected]
- @apollo/[email protected]
2.9.0
Minor Changes
- Implements two new directives for defining custom costs for demand control. The
@cost
directive allows setting a custom weight to a particular field in the graph, overriding the default cost calculation. The@listSize
directive gives the cost calculator information about how to estimate the size of lists returned by subgraphs. This can either be a static size or a value derived from input arguments, such as paging parameters. (#3074)
Patch Changes
-
Reduce memory overhead during satisfiability checking when there are many options. (#3109)
-
Updated dependencies [
acfe3193429c7f99b4fc564b20828aaa8659a75c
,02c2a34a62c3717a4885449172e404f19ebf66c9
,0ccfd937d4b4a576f890665ceebbd7986fac5d0c
,e0a5075c0d12a0e2f7ef303b246e3216a139d3e0
]:- @apollo/[email protected]
- @apollo/[email protected]
2.8.5
Patch Changes
- Updated dependencies []:
- @apollo/[email protected]
- @apollo/[email protected]
2.8.4
Patch Changes
-
When doing interface type intersection detection, allow @interfaceObject to stand in for any type (#3087)
-
Updated dependencies [
5f4bb160d024678d6facd471c43c8ec61c86e701
,672aca7cbeb0a6a38586357a4e154f2dd91caa0c
]:- @apollo/[email protected]
- @apollo/[email protected]
2.8.3
Patch Changes
-
Error messages are now lazily evaluated for satisfiability validations. (#3068)
-
Query graph caches now use maps instead of sparsely-populated arrays for per-subgraph data. (#3066)
-
Add a fast path to skip override validation for fields without any subgraph
@override
s. (#3070) -
Type merging now uses maps instead of sparsely-populated arrays for per-subgraph data. (#3069)
-
Stop duplicating hints for inconsistent value type fields per subgraph. (#3071)
-
Fix logic to compute missing subgraphs when generating composition hints/errors (#3076)
-
Use sets instead of arrays for tracking schema type/directive referencers. (#3067)
-
Updated dependencies [
38debcf2f9af1a719bd1c8acbd9335efa8427ddb
,50d648ccffb05591878de75dc5522914ed48698f
,860aace9904e787f9bf05aad94be5b5920f10543
,f753d55e9a49d11389ee4f8d7976533447e95ede
,3af790517d662f3bec9064c0bf243014c579e9cd
]:- @apollo/[email protected]
- @apollo/[email protected]
2.8.3-beta.2
Patch Changes
- Updated dependencies [
50d648ccffb05591878de75dc5522914ed48698f
]:- @apollo/[email protected]
- @apollo/[email protected]
2.8.3-beta.1
Patch Changes
-
Fix logic to compute missing subgraphs when generating composition hints/errors (#3076)
-
Updated dependencies []:
- @apollo/[email protected]
- @apollo/[email protected]
2.8.3-beta.0
Patch Changes
-
Error messages are now lazily evaluated for satisfiability validations. (#3068)
-
Query graph caches now use maps instead of sparsely-populated arrays for per-subgraph data. (#3066)
-
Add a fast path to skip override validation for fields without any subgraph
@override
s. (#3070) -
Type merging now uses maps instead of sparsely-populated arrays for per-subgraph data. (#3069)
-
Stop duplicating hints for inconsistent value type fields per subgraph. (#3071)
-
Use sets instead of arrays for tracking schema type/directive referencers. (#3067)
-
Updated dependencies [
38debcf2f9af1a719bd1c8acbd9335efa8427ddb
,860aace9904e787f9bf05aad94be5b5920f10543
,f753d55e9a49d11389ee4f8d7976533447e95ede
,3af790517d662f3bec9064c0bf243014c579e9cd
]:- @apollo/[email protected]
- @apollo/[email protected]
2.8.2
Patch Changes
- Updated dependencies [
b2e5ab66f84688ec304cfcf2c6f749c86aded549
]:- @apollo/[email protected]
- @apollo/[email protected]
2.8.1
Patch Changes
-
Fix performance regression in needsJoinField() for large graphs (#3038)
-
Updated dependencies []:
- @apollo/[email protected]
- @apollo/[email protected]
2.8.0
Minor Changes
-
Implement new directives to allow getting and setting context. This allows resolvers to reference and access data referenced by entities that exist in the GraphPath that was used to access the field. The following example demonstrates the ability to access the
prop
field within the Child resolver. (#2988)type Query { p: Parent! } type Parent @key(fields: "id") @context(name: "context") { id: ID! child: Child! prop: String! } type Child @key(fields: "id") { id: ID! b: String! field(a: String @fromContext(field: "$context { prop }")): Int! }
Patch Changes
-
Various set context bugfixes (#3017)
-
Updated dependencies [
c4744da360235d8bb8270ea048f0e0fa5d03be1e
,8a936d741a0c05835ff2533714cf330d18209179
,f5fe3e74d36722f78004c1e2e03c77d8b95cd6bf
]:- @apollo/[email protected]
- @apollo/[email protected]
2.8.0-alpha.1
Patch Changes
- Updated dependencies [
f5fe3e74d36722f78004c1e2e03c77d8b95cd6bf
]:- @apollo/[email protected]
- @apollo/[email protected]
2.8.0-alpha.0
Minor Changes
-
Implement new directives to allow getting and setting context. This allows resolvers to reference and access data referenced by entities that exist in the GraphPath that was used to access the field. The following example demonstrates the ability to access the
prop
field within the Child resolver. (#2988)type Query { p: Parent! } type Parent @key(fields: "id") @context(name: "context") { id: ID! child: Child! prop: String! } type Child @key(fields: "id") { id: ID! b: String! field(a: String @fromContext(field: "$context { prop }")): Int! }
Patch Changes
- Updated dependencies [
c4744da360235d8bb8270ea048f0e0fa5d03be1e
]:- @apollo/[email protected]
- @apollo/[email protected]
2.7.8
Patch Changes
-
Triggering a clean 2.7.8 release now that harmonizer build has been fixed. (#3010)
-
Updated dependencies [
2ad72802044310a528e8944f4538efe519424504
]:- @apollo/[email protected]
- @apollo/[email protected]
2.7.7
Patch Changes
-
No logical changes since 2.7.5 or 2.7.6, but we fixed a bug in the release process, so we need to publish a new patch version (2.7.7). (#2999)
-
Updated dependencies [
bee0b0828b4fb6a1d3172ac330560e2ab6c046bb
]:- @apollo/[email protected]
- @apollo/[email protected]
2.7.6
Patch Changes
-
There is no functionality change between 2.7.5 and 2.7.6. Triggering new release as previous one released partially leading to a broken experience. (#2997)
-
Updated dependencies []:
- @apollo/[email protected]
- @apollo/[email protected]
2.7.5
Patch Changes
- Updated dependencies []:
- @apollo/[email protected]
- @apollo/[email protected]
2.7.4
Patch Changes
- Updated dependencies [
d80b7f0ca1456567a0866a32d2b2abf940598f77
]:- @apollo/[email protected]
- @apollo/[email protected]
2.7.3
Patch Changes
-
Fix a query planning bug where invalid subgraph queries are generated with
reuseQueryFragments
set true. (#2952) (#2963) -
Updated dependencies [
ec04c50b4fb832bfd281ecf9c0c2dd7656431b96
,a494631918156f0431ceace74281c076cf1d5d51
]:- @apollo/[email protected]
- @apollo/[email protected]
2.7.2
Patch Changes
-
When a linked directive requires a federation version higher than the linked federation spec, upgrade to the implied version and issue a hint (#2929)
-
Stop emitting "inconsistent value type" hints against definitions where the type is marked
@external
or all fields are marked@external
. (#2951) -
Introduce a new composition hint pertaining specifically to progressive
@override
usage (when alabel
argument is present). (#2922) -
Updated dependencies [
33b937b18d3c7ca6af14b904696b536399e597d1
,09cd3e55e810ee513127b7440f5b11af7540c9b0
,d7189a86c27891af408d3d0184db6133d3342967
]:- @apollo/[email protected]
- @apollo/[email protected]
2.7.1
Patch Changes
- Updated dependencies [
493f5acd16ad92adf99c963659cd40dc5eac1219
]:- @apollo/[email protected]
- @apollo/[email protected]
2.7.0
Minor Changes
-
Implement progressive
@override
functionality (#2911)The progressive
@override
feature brings a new argument to the@override
directive:label: String
. When a label is added to an@override
application, the override becomes conditional, depending on parameters provided to the query planner (a set of which labels should be overridden). Note that this feature will be supported in router for enterprise users only.Out-of-the-box, the router will support a percentage-based use case for progressive
@override
. For example:type Query { hello: String @override(from: "original", label: "percent(5)") }
The above example will override the root
hello
field from the "original" subgraph 5% of the time.More complex use cases will be supported by the router via the use of coprocessors/rhai to resolve arbitrary labels to true/false values (i.e. via a feature flag service).
-
Support
@join__directive(graphs, name, args)
directives (#2894)
Patch Changes
-
Allow known
FeatureDefinition
subclasses to define custom subgraph schema validation rules (#2910) -
Updated dependencies [
6ae42942b13dccd246ccc994faa2cb36cd62cb3c
,66833fb8d04c9376f6ed476fed6b1ca237f477b7
,931f87c6766c7439936df706727cbdc0cd6bcfd8
]:- @apollo/[email protected]
- @apollo/[email protected]
2.6.3
Patch Changes
- Updated dependencies []:
- @apollo/[email protected]
- @apollo/[email protected]
2.6.2
Patch Changes
- Updated dependencies [
7b5b836d15247c997712a47847f603aa5887312e
,74ca7dd617927a20d79b824851f7651ef3c40a4e
,3f7392b84f8b626b248b59ce81f193d0f0272045
]:- @apollo/[email protected]
- @apollo/[email protected]
2.6.1
Patch Changes
- Updated dependencies [
0d5ab01a
]:- @apollo/[email protected]
- @apollo/[email protected]
2.6.0
Minor Changes
-
Update
license
field inpackage.json
to useElastic-2.0
SPDX identifier (#2741) -
Introduce the new
@policy
scope for composition (#2818)Note that this directive will only be fully supported by the Apollo Router as a GraphOS Enterprise feature at runtime. Also note that composition of valid
@policy
directive applications will succeed, but the resulting supergraph will not be executable by the Gateway or an Apollo Router which doesn't have the GraphOS Enterprise entitlement.Users may now compose
@policy
applications from their subgraphs into a supergraph.The directive is defined as follows:
scalar federation__Policy directive @policy( policies: [[federation__Policy!]!]! ) on FIELD_DEFINITION | OBJECT | INTERFACE | SCALAR | ENUM
The
Policy
scalar is effectively aString
, similar to theFieldSet
type.In order to compose your
@policy
usages, you must update your subgraph's federation spec version to v2.6 and add the@policy
import to your existing imports like so:@link(url: "https://specs.apollo.dev/federation/v2.6", import: [..., "@policy"])
Patch Changes
- Updated dependencies [
b18841be
,e325b499
]:- @apollo/[email protected]
- @apollo/[email protected]
2.5.7
Patch Changes
- Updated dependencies []:
- @apollo/[email protected]
- @apollo/[email protected]
2.5.6
Patch Changes
-
Fixing issue where redeclaration of custom scalars in a fed1 schema may cause upgrade errors (#2809)
-
Updated dependencies [
c719214a
]:- @apollo/[email protected]
- @apollo/[email protected]
2.5.5
Patch Changes
- Updated dependencies []:
- @apollo/[email protected]
- @apollo/[email protected]
2.5.4
Patch Changes
- Updated dependencies []:
- @apollo/[email protected]
- @apollo/[email protected]
2.5.3
Patch Changes
-
Modifies the type for the argument of the
@requiresScopes
from[federation__Scope!]!
to[[federation__Scope!]!]!
. (#2738)The
@requiresScopes
directives has been pre-emptively introduced in 2.5.0 to support an upcoming Apollo Router
feature around scoped accesses. The argument for@requiresScopes
in that upcoming feature is changed to accommodate a
new semantic. Note that this technically a breaking change to the@requiresScopes
directive definition, but as the
full feature using that directive has been released yet, this directive cannot effectively be used and this should have
no concrete impact. -
Updated dependencies [
4b9a512b
,c6e0e76d
,1add932c
,6f1fddb2
]:- @apollo/[email protected]
- @apollo/[email protected]
2.5.2
Patch Changes
- Updated dependencies [
35179f08
]:- @apollo/[email protected]
- @apollo/[email protected]
2.5.1
Patch Changes
- Updated dependencies [
b9052fdd
]:- @apollo/[email protected]
- @apollo/[email protected]
2.5.0
Minor Changes
-
Do not run the full suite of graphQL validations on supergraphs and their extracted subgraphs by default in production environment. (#2657)
Running those validations on every updates of the schema takes a non-negligible amount of time (especially on large
schema) and mainly only serves in catching bugs early in the supergraph handling code, and in some limited cases,
provide slightly better messages when a corrupted supergraph is received, neither of which is worth the cost in
production environment.A new
validateSupergraph
option is also introduced in the gateway configuration to force this behaviour. -
Includes an optional Schema Coordinate field in the Composition Hints returned by composition (#2658)
-
For CoreSpecDefintions that opt in, we've added the ability to tie the core spec version to a particular federation version. That means that if there's a new version of, say, the join spec, you won't necessarily get the new version in the supergraph schema if no subgraph requires it. (#2528)
-
Introduce the new
@authenticated
directive for composition (#2644)Note that this directive will only be fully supported by the Apollo Router as a GraphOS Enterprise feature at runtime. Also note that composition of valid
@authenticated
directive applications will succeed, but the resulting supergraph will not be executable by the Gateway or an Apollo Router which doesn't have the GraphOS Enterprise entitlement.Users may now compose
@authenticated
applications from their subgraphs into a supergraph. This addition will support a future version of Apollo Router that enables authenticated access to specific types and fields via directive applications.The directive is defined as follows:
directive @authenticated on FIELD_DEFINITION | OBJECT | INTERFACE | SCALAR | ENUM
In order to compose your
@authenticated
usages, you must update your subgraph's federation spec version to v2.5 and add the@authenticated
import to your existing imports like so:@link(url: "https://specs.apollo.dev/federation/v2.5", import: [..., "@authenticated"])
-
Introduce the new
@requiresScopes
directive for composition (#2649)Note that this directive will only be fully supported by the Apollo Router as a GraphOS Enterprise feature at runtime. Also note that composition of valid
@requiresScopes
directive applications will succeed, but the resulting supergraph will not be executable by the Gateway or an Apollo Router which doesn't have the GraphOS Enterprise entitlement.Users may now compose
@requiresScopes
applications from their subgraphs into a supergraph. This addition will support a future version of Apollo Router that enables scoped access to specific types and fields via directive applications.The directive is defined as follows:
scalar federation__Scope directive @requiresScopes( scopes: [federation__Scope!]! ) on FIELD_DEFINITION | OBJECT | INTERFACE | SCALAR | ENUM
The
Scope
scalar is effectively aString
, similar to theFieldSet
type.In order to compose your
@requiresScopes
usages, you must update your subgraph's federation spec version to v2.5 and add the@requiresScopes
import to your existing imports like so:@link(url: "https://specs.apollo.dev/federation/v2.5", import: [..., "@requiresScopes"])
Patch Changes
- Updated dependencies [
fe1e3d7b
,6b18af50
,9396c0d6
,2b5796a9
,4f3c3b9e
]:- @apollo/[email protected]
- @apollo/[email protected]
2.4.10
Patch Changes
- Updated dependencies [
b6be9f96
]:- @apollo/[email protected]
- @apollo/[email protected]
2.4.9
Patch Changes
- Updated dependencies [
7ac83456
,d60349b3
,1bb7c512
,02eab3ac
,fd4545c2
]:- @apollo/[email protected]
- @apollo/[email protected]
2.4.8
Patch Changes
- Updated dependencies [
62e0d254
,7f1ef73e
,2a97f372
]:- @apollo/[email protected]
- @apollo/[email protected]
2.4.7
Patch Changes
- Re-work the code use to try to reuse query named fragments to improve performance (thus sometimes improving query (#2604)
planning performance), to fix a possibly raised assertion error (with a message of form likeCannot add selection of field X to selection set of parent type Y
), and to fix a rare issue where an interface or union field was not being
queried for all the types it should be. - Updated dependencies [
2d44f346
]:- @apollo/[email protected]
- @apollo/[email protected]
2.4.6
Patch Changes
- Updated dependencies [
5cd17e69
,e136ad87
]:- @apollo/[email protected]
- @apollo/[email protected]
2.4.5
Patch Changes
-
Supersedes v2.4.4 due to a publishing error with no dist/ folder (#2583)
-
Updated dependencies [
c96e24c4
]:- @apollo/[email protected]
- @apollo/[email protected]
2.4.4
Patch Changes
- Updated dependencies []:
- @apollo/[email protected]
- @apollo/[email protected]
2.4.3
Patch Changes
- Updated dependencies [
f6a8c1ce
]:- @apollo/[email protected]
- @apollo/[email protected]
2.4.2
Patch Changes
- Allow passing print options to the
compose
method to impact how the supergraph is printed, and adds new printing (#2042)
options to order all elements of the schema. - Updated dependencies [
2c370508
,179b4602
]:- @apollo/[email protected]
- @apollo/[email protected]
2.4.1
Patch Changes
-
Start building packages with TS 5.x, which should have no effect on consumers (#2480)
-
Updated dependencies [
450b9578
,afde3158
,eafebc3c
,01fe3f83
]:- @apollo/[email protected]
- @apollo/[email protected]
2.4.0
Minor Changes
- Addition of new query planner node types to enable federated subscriptions support (#2389)
Patch Changes
-
Refactor the internal implementation of selection sets used by the query planner to decrease the code complexity and (#2387)
improve query plan generation performance in many cases. -
Optimises query plan generation for parts of queries that can statically be known to not cross across subgraphs (#2449)
-
Updated dependencies [
260c357c
,7bc0f8e8
,1a555d98
,cab383b2
]:- @apollo/[email protected]
- @apollo/[email protected]
2.4.0-alpha.1
Patch Changes
- Updated dependencies [
7bc0f8e8
]:- @apollo/[email protected]
- @apollo/[email protected]
2.4.0-alpha.0
Minor Changes
- Addition of new query planner node types to enable federated subscriptions support (#2389)
Patch Changes
- Updated dependencies [
6e2d24b5
,1a555d98
]:- @apollo/[email protected]
- @apollo/[email protected]
2.3.5
Patch Changes
- Updated dependencies []:
- @apollo/[email protected]
- @apollo/[email protected]
2.3.4
Patch Changes
- Updated dependencies [
6e2d24b5
]:- @apollo/[email protected]
- @apollo/[email protected]
2.3.3
Patch Changes
-
Stop generating misleading "hint" regarding value type fields for interface types that are entity interfaces (they have a
@key
defined). (#2412) -
Updated dependencies [
de89e504
]:- @apollo/[email protected]
- @apollo/[email protected]
2.3.2
Patch Changes
- Updated dependencies []:
- @apollo/[email protected]
- @apollo/[email protected]
2.3.1
Patch Changes
- Updated dependencies [
7e2ca46f
]:- @apollo/[email protected]
- @apollo/[email protected]
This CHANGELOG pertains only to Apollo Federation packages in the 2.x range. The Federation v0.x equivalent for this package can be found here on the version-0.x
branch of this repo.
2.3.0-beta.2
- Error on composition when a
@shareable
field runtime types don't intersect between subgraphs: a@shareable
field
must resolve the same way in all the subgraphs, but this is impossible if the concrete runtime types have no
intersection at all PR #1556. - Uses the 0.3 version of the tag spec in the supergraph, which adds
@tag
directive support for theSCHEMA
location PR #2314. - Fixes composition issues with
@interfaceObject
PR #2318.
2.3.0-alpha.0
- Preserves source of union members and enum values in supergraph PR #2288.
- BREAKING: composition now rejects
@override
on interface fields. The@override
directive was not
meant to be supported on interfaces and was not having any impact whatsoever. If an existing subgraph does have a
@override
on an interface field, this will now be rejected, but the@override
can simply and safely be removed
since it previously was ignored.
2.2.0
- BREAKING: composition now rejects
@shareable
on interface fields. The@shareable
directive is about
controlling if multiple subgraphs can resolve a particular field, and as interface field are never directly resolved
(it's their implementation that are), having@shareable
on interface fields is not completely meaningful and
was never meant to be supported. If an existing subgraph does have a@shareable
on an interface field, this
will now be rejected, but the@shareable
can simply and safely be removed since it previously was ignored. - Provide support for marking @external on object type PR #2214
- Drop support for node12 PR #2202
- Fix error when a skipped enum value had directives applied PR #2232.
2.1.4
- Improves error message to help with misspelled source of an
@override
PR #2181.
2.1.2
- Fix composition of repeatable custom directives PR #2136
- Allow fields with arguments in
@requires
PR #2120.
2.1.0
- Don't apply @Shareable when upgrading fed1 supergraphs if it's already @Shareable PR #2043
- Update peer dependency
graphql
to^16.5.0
to useGraphQLErrorOptions
PR #2060 - Don't require
@link
when using@composeDirective
PR #2046 - Add
@composeDirective
directive to specify directives that should be merged to the supergraph during composition PR #1996. - Warn on merging inconsistent non-repeatable directive applications instead of failing composition PR #1840.
- Expand support for Node.js v18 PR #1884
v2.0.1
- Use
for: SECURITY
in the core/link directive application in the supergraph for@inaccessible
PR #1715
v2.0.0
- Previous preview release promoted to general availability! Please see previous changelog entries for full info.
v2.0.0-preview.11
- Add a level to hints, uppercase their code and related fixes PR #1683.
- Add support for
@inaccessible
v0.2 PR #1678
v2.0.0-preview.10
- Fix merging of Input objects and enum types PR #1672.
- Fix regression in composition validation introduced by #1653 PR #1673.
- Add nodes when displaying hints for
@override
PR #1684
v2.0.0-preview.9
- Fix handling of core/link when definitions are provided or partially so PR #1662.
- Optimize composition validation when many entities spans many subgraphs PR #1653.
- Support for Node 17 PR #1541.
- 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. - Adds support for the
@override
directive on fields to indicate that a field should be moved from one subgraph to another. PR #1484
v2.0.0-preview.8
NOTE: Be sure to upgrade the gateway before re-composing/deploying with this version. See below and the changelog for @apollo/gateway
.
- Adds support for
@inaccessible
in subgraphs PR #1638. - Fix merging of
@tag
directive when it is renamed in subgraphs PR #1637. - Generates supergraphs with
@link
instead of@core
. As a result, prior federation 2 pre-release gateway will not read supergraphs generated by this version correctly, so you should upgrade the gateway to this version before re-composing/deploying with this version. PR #1628.
v2.0.0-preview.5
- 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.
v2.0.0-preview.4
- Released in sync with other federation packages but no changes to this package.
v2.0.0-preview.3
- Released in sync with other federation packages but no changes to this package.
v2.0.0-preview.2
- Re-publishing release which published to npm with stale build artifacts from
version-0.x
release.
v2.0.0-preview.1
- No-op publish to account for publishing difficulties.
v2.0.0-preview.0
- Initial "preview" release.
v2.0.0-alpha.6
- No direct changes, only transitive updates to
@apollo/query-graphs
and@apollo/federation-internals
.
v2.0.0-alpha.5
- Remove
graphql@15
from peer dependencies PR #1472.
v2.0.0-alpha.3
- Assign and document error codes for all errors PR #1274.
v2.0.0-alpha.2
- BREAKING: Bump graphql peer dependency to
^15.7.0
PR #1200 - Add missing dependency to
@apollo/query-graphs
v2.0.0-alpha.1
- 🎉 Initial alpha release of Federation 2.0. For more information, see our documentation. We look forward to your feedback!