Apollo Connectors Changelog


caution
Router and composition versions must be upgraded together.

2025-02-06

Router 2.0.0-preview.6 & Composition 2.10.0-preview.6

Fixes

  • Improve composition performance

  • Provide a clearer error when the version of connectors is incorrect in a @link directive

2025-01-31

Router 2.0.0-preview.5 & Composition 2.10.0-preview.5

Breaking changes

  • When the ->map method is applied to a non-list value, the result is now a list. For example $(1)->map(@) results in [1].

New features

New validations

  • Validations on the http.body now catch more types of errors. For example, validations now flag selections that don't come from a variable (myField instead of $this.myField).

Fixes

  • The router no longer tries to parse an empty API response. If your API responds with nothing, you can use literal values like success: $(true) to map to your schema.

  • The @cost and @listSize directives are preserved to support Demand Control.

  • Types marked with @external are handled correctly.

2025-01-15

Router 2.0.0-preview.4 & Composition 2.10.0-preview.4

Breaking changes

  • Adding a @key directive to a type signals to the query planner that this subgraph implements an entity resolver for that type. When using connectors, you can accomplish this by adding an entity: true argument to the connector.

    • If you see an error like Entity resolution for @key(fields: "id") on Product is not implemented by a connector, it means you need to either add an entity: true connector or add resolvable: false to the@key directive.

    • See the Rules for entity: true for more details.

  • Header expressions now match the behavior of URI templates, so arrays and objects are no longer allowed. You can restore the old behavior using ->jsonStringify or explore other methods.

New features

  • Includes all changes from router v1.59.1.

  • Better type inference and validations for selection mappings.

  • The jsonStringify value transformation is available to JSON stringify any value.

  • Expressions within URIs and headers now support the full power of mapping expressions.

    • Within the dynamic { } pieces of a URI or header, you can apply the same transformations allowed within selection and body.

    • The expression's result must be a simple scalar value.

    • Arrays and objects can't be serialized into URI or header values.

2024-12-09

Router 2.0.0-preview.3 & Composition 2.10.0-preview.3

Breaking changes to URI templates

  • Arrays and objects can no longer be used in URI templates. If you need to convert complex types into URI parameters, contact Apollo to request new functionality and how you'd like them to be serialized.

  • null values will now render in URIs as empty strings ("") instead of "null".

  • If an expression within the key or value of a query parameter is missing, it will now be rendered as an empty string instead of omitting the query parameter entirely.

  • Missing values in path parameters will now render as empty strings instead of returning errors.

New validations

  • Certain headers are already restricted by the router. Composition will now emit an error if one of these is set in @source or @connect.

  • Variables used within headers are now validated at composition time.

New features

  • Includes all changes from router v1.58.1.

  • $args and $this variables can be used in HTTP headers for connectors.

  • The $context variable is available in selection mapping, as well as URLs, headers, and body mappings.

  • The $status variable, representing the HTTP Status Code (200, 404, etc.) is available in selection mapping.

Bug fixes

  • Fixed a couple of edge cases where composition would fail. A small fraction of supergraph still do not compose.

  • Connectors debugging information is now included for multipart responses, like when @defer is used.

  • Composition will no longer emit "unused field" errors if another error (such as a selection parse error) happens first. This makes it easier to spot the most important errors.

  • Escape sequences in selection and body strings are handled correctly.

2024-11-08

Router 2.0.0-preview.1 & Composition 2.10.0-preview.2

New features

  • Includes all changes from Router 1.57.0.

  • Router telemetry can now be configured for connectors.

  • Connectors can now invoke AWS HTTP APIs using SigV4.

  • The content-length header is automatically set on POST, PATCH, and PUT requests.

  • Error messages for parsing errors in @connect(selection:) and @connect(http: { body: }) are more informative.

  • Using coprocessors to fetch authentication tokens is now easier. See authentication with coprocessors.

Bug fixes

  • Fixed a bug where $this.siblingField.nestedField failed to compose.

  • A non-JSON response no longer causes all responses to fail.

2024-10-01

Router 2.0.0-preview.0 & Composition 2.10.0-preview.0

Selection mapping enhancements

  • To distinguish a path consisting of a single key from a field name, you should now use $.key instead of .key. The .key syntax is now forbidden since it can accidentally parse as a continuation of a previous selection, whereas $.key is unambiguous.

  • Multiple deeply nested properties can now be flattened into the same output object alongside shallower properties:

    GraphQL
    1id
    2model
    3choices->first.message { role content }

    This selection produces an object with id, model, role, and content properties, all at the same level.

    Previously, to achieve the same output, it was necessary to repeat the choices->first.message path multiple times:

    GraphQL
    1id
    2model
    3role: choices->first.message.role
    4content: choices->first.message.content

Improvements

  • Includes all changes from router release 1.56.

2024-09-23

Router 2.0.0-alpha.7 & Composition 2.10.0-alpha.4

Selection mapping enhancements

New validations

  • URL template arguments are now validated and must correspond to existing fields ($this) or arguments ($args).

  • entity: true connectors have several new validations, including enforcing that arguments match entity fields.

2024-09-11

Router 2.0.0-alpha.6 & Composition 2.10.0-alpha.3

New validations

  • Require that all fields are resolvable through a connector.

New features

  • Connectors now obey the include_subgraph_errors configuration.

Improvements

  • Includes all changes from router release 1.54.

  • When running the router in development mode, the local Sandbox will have the connectors debug panel enabled by default.

2024-09-06

Router 2.0.0-alpha.5 & Composition 2.10.0-alpha.2

New validations

  • Require that every field of an object is included in at least one selection.

  • When using connectors, require that fields with arguments use a @connect directive.

New features

Improvements

  • Includes all changes from router release 1.52.1.

  • Includes all changes from router release 1.53.0.

  • Includes all changes from federation composition release 2.9.0.

  • Better detect circular references in connector selections.

2024-08-20

Router 2.0.0-alpha.3 & Composition 2.10.0-alpha.0

New validations

New errors will be caught during composition, which may cause previously successful compositions to fail:

  • Referring to a field name within selection which doesn't exist.

Improvements

  • Fully support $this and $args in http.body.

  • Allow subgraph names which are not GraphQL identifiers, for example, my-subgraph.

  • Allow $config values in headers.

  • Ability to set request limits for connectors.

Feedback

Forums