Skip to content

@apollo/[email protected]

Pre-release
Pre-release
Compare
Choose a tag to compare
@github-actions github-actions released this 23 Sep 19:25
· 25 commits to main since this release
98285e5

CHANGELOG for @apollo/composition

2.9.1

Patch Changes

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

2.8.5

Patch Changes

2.8.4

Patch Changes

2.8.3

Patch Changes

2.8.3-beta.2

Patch Changes

2.8.3-beta.1

Patch Changes

2.8.3-beta.0

Patch Changes

2.8.2

Patch Changes

2.8.1

Patch Changes

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

2.8.0-alpha.1

Patch Changes

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

2.7.8

Patch Changes

2.7.7

Patch Changes

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 []:

2.7.5

Patch Changes

2.7.4

Patch Changes

2.7.3

Patch Changes

2.7.2

Patch Changes

2.7.1

Patch Changes

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

2.6.3

Patch Changes

2.6.2

Patch Changes

2.6.1

Patch Changes

2.6.0

Minor Changes

  • Update license field in package.json to use Elastic-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 a String, similar to the FieldSet 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

2.5.7

Patch Changes

2.5.6

Patch Changes

2.5.5

Patch Changes

2.5.4

Patch Changes

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]:

2.5.2

Patch Changes

2.5.1

Patch Changes

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 a String, similar to the FieldSet 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

2.4.10

Patch Changes

2.4.9

Patch Changes

2.4.8

Patch Changes

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 like Cannot 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]:

2.4.6

Patch Changes

2.4.5

Patch Changes

2.4.4

Patch Changes

2.4.3

Patch Changes

2.4.2

Patch Changes

2.4.1

Patch Changes

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]:

2.4.0-alpha.1

Patch Changes

2.4.0-alpha.0

Minor Changes

  • Addition of new query planner node types to enable federated subscriptions support (#2389)

Patch Changes

2.3.5

Patch Changes

2.3.4

Patch Changes

2.3.3

Patch Changes

2.3.2

Patch Changes

2.3.1

Patch Changes

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 the SCHEMA 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 use GraphQLErrorOptions 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!