Skip to content

Conversation

@renovate
Copy link
Contributor

@renovate renovate bot commented Jul 17, 2025

This PR contains the following updates:

Package Change Age Confidence
@apollo/client (source) 3.14.04.1.0 age confidence
@apollo/server (source) 4.12.25.2.0 age confidence

Release Notes

apollographql/apollo-client (@​apollo/client)

v4.1.0

Compare Source

Minor Changes
  • #​13043 65e66ca Thanks @​jerelmiller! - Support headers transport for enhanced client awareness.

  • #​12927 785e223 Thanks @​jerelmiller! - You can now provide a callback function as the context option on the mutate function returned by useMutation. The callback function is called with the value of the context option provided to the useMutation hook. This is useful if you'd like to merge the context object provided to the useMutation hook with a value provided to the mutate function.

    function MyComponent() {
      const [mutate, result] = useMutation(MUTATION, {
        context: { foo: true },
      });
    
      async function runMutation() {
        await mutate({
          // sends context as { foo: true, bar: true }
          context: (hookContext) => ({ ...hookContext, bar: true }),
        });
      }
    
      // ...
    }
  • #​12923 94ea3e3 Thanks @​jerelmiller! - Fix an issue where deferred payloads that returned arrays with fewer items than the original cached array would retain items from the cached array. This change includes @stream arrays where stream arrays replace the cached arrays.

  • #​12927 96b531f Thanks @​jerelmiller! - Don't set the fallback value of a @client field to null when a read function is defined. Instead the read function will be called with an existing value of undefined to allow default arguments to be used to set the returned value.

    When a read function is not defined nor is there a defined resolver for the field, warn and set the value to null only in that instance.

  • #​12927 45ebb52 Thanks @​jerelmiller! - Add support for from: null in client.watchFragment and cache.watchFragment. When from is null, the emitted result is:

    {
      data: null,
      dataState: "complete",
      complete: true,
    }
  • #​12926 2b7f2c1 Thanks @​jerelmiller! - Support the newer incremental delivery format for the @defer directive implemented in graphql@17.0.0-alpha.9. Import the GraphQL17Alpha9Handler to use the newer incremental delivery format with @defer.

    import { GraphQL17Alpha9Handler } from "@​apollo/client/incremental";
    
    const client = new ApolloClient({
      // ...
      incrementalHandler: new GraphQL17Alpha9Handler(),
    });

    [!NOTE]
    In order to use the GraphQL17Alpha9Handler, the GraphQL server MUST implement the newer incremental delivery format. You may see errors or unusual behavior if you use the wrong handler. If you are using Apollo Router, continue to use the Defer20220824Handler because Apollo Router does not yet support the newer incremental delivery format.

  • #​12927 45ebb52 Thanks @​jerelmiller! - Add support for arrays with useFragment, useSuspenseFragment, and client.watchFragment. This allows the ability to use a fragment to watch multiple entities in the cache. Passing an array to from will return data as an array where each array index corresponds to the index in the from array.

    function MyComponent() {
      const result = useFragment({
        fragment,
        from: [item1, item2, item3],
      });
    
      // `data` is an array with 3 items
      console.log(result); // { data: [{...}, {...}, {...}], dataState: "complete", complete: true }
    }
  • #​12927 45ebb52 Thanks @​jerelmiller! - Add a getCurrentResult function to the observable returned by client.watchFragment and cache.watchFragment that returns the current value for the watched fragment.

    const observable = client.watchFragment({
      fragment,
      from: { __typename: "Item", id: 1 },
    });
    
    console.log(observable.getCurrentResult());
    // {
    //   data: {...},
    //   dataState: "complete",
    //   complete: true,
    // }
  • #​13038 109efe7 Thanks @​jerelmiller! - Add the from option to readFragment, watchFragment, and updateFragment.

  • #​12918 2e224b9 Thanks @​jerelmiller! - Add support for the @stream directive on both the Defer20220824Handler and the GraphQL17Alpha2Handler.

    [!NOTE]
    The implementations of @stream differ in the delivery of incremental results between the different GraphQL spec versions. If you upgrading from the older format to the newer format, expect the timing of some incremental results to change.

  • #​13056 b224efc Thanks @​jerelmiller! - InMemoryCache no longer filters out explicitly returned undefined items from read functions for array fields. This now makes it possible to create read functions on array fields that return partial data and trigger a fetch for the full list.

  • #​13058 121a2cb Thanks @​jerelmiller! - Add an extensions option to cache.write, cache.writeQuery, and client.writeQuery. This makes extensions available in cache merge functions which can be accessed with the other merge function options.

    As a result of this change, any extensions returned in GraphQL operations are now available in merge in the cache writes for these operations.

  • #​12927 96b531f Thanks @​jerelmiller! - Add an abstract resolvesClientField function to ApolloCache that can be used by caches to tell LocalState if it can resolve a @client field when a local resolver is not defined.

    LocalState will emit a warning and set a fallback value of null when no local resolver is defined and resolvesClientField returns false, or isn't defined. Returning true from resolvesClientField signals that a mechanism in the cache will set the field value. In this case, LocalState won't set the field value.

  • #​13078 bf1e0dc Thanks @​phryneas! - Use the default stream merge function for @stream fields only if stream info is present. This change means that using the older Defer20220824Handler will not use the default stream merge function and will instead truncate the streamed array on the first chunk.

Patch Changes
  • #​12884 d329790 Thanks @​phryneas! - Ensure that PreloadedQueryRef instances are unsubscribed when garbage collected

  • #​13086 1a1d408 Thanks @​phryneas! - Change the returned value from null to {} when all fields in a query were skipped.

    This also fixes a bug where useSuspenseQuery would suspend indefinitely when all fields were skipped.

  • #​13010 7627000 Thanks @​jerelmiller! - Fix an issue where errors parsed from incremental chunks in ErrorLink might throw when using the GraphQL17Alpha9Handler.

  • #​12927 45ebb52 Thanks @​jerelmiller! - Deduplicate watches created by useFragment, client.watchFragment, and cache.watchFragment that contain the same fragment, variables, and identifier. This should improve performance in situations where a useFragment or a client.watchFragment is used to watch the same object in multiple places of an application.

  • #​12927 259ae9b Thanks @​jerelmiller! - Allow FragmentType not only to be called as FragmentType<TData>, but also as FragmentType<TypedDocumentNode>.

  • #​12925 5851800 Thanks @​jerelmiller! - Fix an issue where calling fetchMore with @defer or @stream would not rerender incremental results as they were streamed.

  • #​12927 9e55188 Thanks @​jerelmiller! - Truncate @stream arrays only on last chunk by default.

  • #​13083 f3c2be1 Thanks @​phryneas! - Expose the ExtensionsWithStreamInfo type for extensions in Cache.writeQuery, Cache.write and Cache.update so other cache implementations also can correctly access them.

  • #​12923 94ea3e3 Thanks @​jerelmiller! - Improve the cache data loss warning message when existing or incoming is an array.

  • #​12927 4631175 Thanks @​jerelmiller! - Ignore top-level data values on subsequent chunks in incremental responses.

  • #​12927 2be8de2 Thanks @​jerelmiller! - Create mechanism to add experimental features to Apollo Client

  • #​12927 96b531f Thanks @​jerelmiller! - Ensure LocalState doesn't try to read from the cache when using a no-cache fetch policy.

  • #​12927 bb8ed7b Thanks @​jerelmiller! - Ensure an error is thrown when @stream is detected and an incrementalDelivery handler is not configured.

  • #​13053 23ca0ba Thanks @​phryneas! - Use memoized observable mapping when using watchFragment, useFragment or useSuspenseFragment.

  • #​12927 44706a2 Thanks @​jerelmiller! - Add helper type QueryRef.ForQuery<TypedDocumentNode>

  • #​13082 c257418 Thanks @​phryneas! - Pass streamInfo through result extensions as a WeakRef.

  • #​12927 4631175 Thanks @​jerelmiller! - Fix the Defer20220824Handler.SubsequentResult type to match the FormattedSubsequentIncrementalExecutionResult type in graphql@17.0.0-alpha.2.

  • #​12927 96b531f Thanks @​jerelmiller! - Warn when using a no-cache fetch policy without a local resolver defined. no-cache queries do not read or write to the cache which meant no-cache queries are silently incomplete when the @client field value was handled by a cache read function.

  • #​12927 5776ea0 Thanks @​jerelmiller! - Update the accept header used with the GraphQL17Alpha9Handler to multipart/mixed;incrementalSpec=v0.2 to ensure the newest incremental delivery format is requested.

  • #​12927 45ebb52 Thanks @​jerelmiller! - DeepPartial<Array<TData>> now returns Array<DeepPartial<TData>> instead of Array<DeepPartial<TData | undefined>>.

  • #​13071 99ffe9a Thanks @​phryneas! - prerenderStatic: Expose return value of renderFunction to userland, fix aborted property.

    This enables usage of resumeAndPrerender with React 19.2.

  • #​13026 05eee67 Thanks @​jerelmiller! - Reduce the number of observables created by watchFragment by reusing existing observables as much as possible. This should improve performance when watching the same item in the cache multiple times after a cache update occurs.

  • #​13010 7627000 Thanks @​jerelmiller! - Handle @stream payloads that send multiple items in the same chunk when using the Defer20220824Handler.

  • #​13010 7627000 Thanks @​jerelmiller! - Handle an edge case with the Defer20220824Handler where an error for a @stream item that bubbles to the @stream boundary (such as an item returning null for a non-null array item) would write items from future chunks to the wrong array index. In these cases, the @stream field is no longer processed and future updates to the field are ignored. This prevents runtime errors that TypeScript would otherwise not be able to catch.

  • #​13081 1e06ad7 Thanks @​jerelmiller! - Avoid calling merge functions more than once for the same incremental chunk.

v4.0.13

Compare Source

Patch Changes
  • #​13094 9cbe2c2 Thanks @​phryneas! - Ensure that compact and mergeOptions preserve symbol keys.

    This fixes an issue where the change introduced in 4.0.11 via #​13049 would not
    be applied if defaultOptions for watchQuery were declared.

    Please note that compact and mergeOptions are considered internal utilities
    and they might have similar behavior changes in future releases.
    Do not use them in your application code - a change like this is not considered
    breaking and will not be announced as such.

v4.0.12

Compare Source

Patch Changes

v4.0.11

Compare Source

Patch Changes
  • #​13050 8020829 Thanks @​phryneas! - Replace usage of findLast with more backwards-compatible methods.

  • #​13049 05638de Thanks @​phryneas! - Fixes an issue where queries starting with skipToken or lazy queries from useLazyQuery were included in client.refetchQueries() before they had been executed for the first time. While generally queries with a standby fetchPolicy should be included in refetch, these queries never had variables passed in, so they should be excluded until they have run once and received their actual variables.

    These queries are now properly excluded from refetch operations until after their initial execution.

    This change adds a new hidden option to client.watchQuery, [variablesUnknownSymbol], which may be set true for queries starting with a fetchPolicy of standby. It will only be applied when creating the ObservableQuery instance and cannot be changed later. This flag indicates that the query's variables are not yet known, and thus it should be excluded from refetch operations until they are.
    This option is not meant for everyday use and is intended for framework integrations only.

v4.0.10

Compare Source

Patch Changes

v4.0.9

Compare Source

Patch Changes
  • #​12993 8f3bc9b Thanks @​jerelmiller! - Fix an issue where switching from options with variables to skipToken with useSuspenseQuery and useBackgroundQuery would create a new ObservableQuery. This could cause unintended refetches where variables were absent in the request when the query was referenced with refetchQueries.

v4.0.8

Compare Source

Patch Changes

v4.0.7

Compare Source

Patch Changes

v4.0.6

Compare Source

Patch Changes
  • #​12937 3b0d89b Thanks @​phryneas! - Fix a problem with fetchMore where the loading state wouldn't reset if the result wouldn't result in a data update.

v4.0.5

Compare Source

Patch Changes

v4.0.4

Compare Source

Patch Changes
  • #​12892 db8a04b Thanks @​jerelmiller! - Prevent unhandled rejections from the promise returned by calling the mutate function from the useMutation hook.

  • #​12899 5352c12 Thanks @​phryneas! - Fix an issue when invariant is called by external libraries when no dev error message handler is loaded.

  • #​12895 71f2517 Thanks @​jerelmiller! - Support skipToken with useQuery to provide a more type-safe way to skip query execution.

    import { skipToken, useQuery } from "@&#8203;apollo/client/react";
    
    // Use `skipToken` in place of `skip: true` for better type safety
    // for required variables
    const { data } = useQuery(QUERY, id ? { variables: { id } } : skipToken);

    Note: this change is provided as a patch within the 4.0 minor version because the changes to TypeScript validation with required variables in version 4.0 made using the skip option more difficult.

  • #​12900 c0d5be7 Thanks @​phryneas! - Use named export equal instead of default from "@&#8203;wry/equality"

v4.0.3

Compare Source

Patch Changes

v4.0.2

Compare Source

Patch Changes

v4.0.1

Compare Source

Patch Changes
  • #​12876 b00f231 Thanks @​phryneas! - Fix CJS build output for invariantErrorCodes

  • #​12866 0d1614a Thanks @​jerelmiller! - Export isNetworkStatusInFlight from @apollo/client/utilities. Add isNetworkStatusSettled to @apollo/client/utilities and re-export it from @apollo/client with a deprecation.

v4.0.0

Compare Source

apollographql/apollo-server (@​apollo/server)

v5.2.0

Compare Source

Minor Changes
  • #​8161 51acbeb Thanks @​jerelmiller! - Fix an issue where some bundlers would fail to build because of the dynamic import for the optional peer dependency on @yaacovcr/transform introduced in @apollo/server 5.1.0. To provide support for the legacy incremental format, you must now provide the legacyExperimentalExecuteIncrementally option to the ApolloServer constructor.

    import { legacyExecuteIncrementally } from '@&#8203;yaacovcr/transform';
    
    const server = new ApolloServer({
      // ...
      legacyExperimentalExecuteIncrementally: legacyExecuteIncrementally,
    });

    If the legacyExperimentalExecuteIncrementally option is not provided and the client sends an Accept header with a value of multipart/mixed; deferSpec=20220824, an error is returned by the server.

v5.1.0

Compare Source

Minor Changes
  • #​8148 80a1a1a Thanks @​jerelmiller! - Apollo Server now supports the incremental delivery protocol (@defer and @stream) that ships with graphql@17.0.0-alpha.9. To use the current protocol, clients must send the Accept header with a value of multipart/mixed; incrementalSpec=v0.2.

    Upgrading to 5.1 will depend on what version of graphql you have installed and whether you already support the incremental delivery protocol.

v5.0.0

Compare Source

BREAKING CHANGES

Apollo Server v5 has very few breaking API changes. It is a small upgrade focused largely on adjusting which versions of Node.js and Express are supported.

Read our migration guide for more details on how to update your app.

  • Dropped support for Node.js v14, v16, and v18, which are no longer under long-term support from the Node.js Foundation. Apollo Server 5 supports Node.js v20 and later; v24 is recommended. Ensure you are on a non-EOL version of Node.js before upgrading Apollo Server.
  • Dropped support for versions of the graphql library older than v16.11.0. (Apollo Server 4 supports graphql v16.6.0 or later.) Upgrade graphql before upgrading Apollo Server.
  • Express integration requires a separate package. In Apollo Server 4, you could import the Express 4 middleware from @apollo/server/express4, or you could import it from the separate package @as-integrations/express4. In Apollo Server 5, you must import it from the separate package. You can migrate your server to the new package before upgrading to Apollo Server 5. (You can also use @as-integrations/express5 for a middleware that works with Express 5.)
  • Usage Reporting, Schema Reporting, and Subscription Callback plugins now use the Node.js built-in fetch implementation for HTTP requests by default, instead of the node-fetch npm package. If your server uses an HTTP proxy to make HTTP requests, you need to configure it in a slightly different way. See the migration guide for details.
  • The server started with startStandaloneServer no longer uses Express. This is mostly invisible, but it does set slightly fewer headers. If you rely on the fact that this server is based on Express, you should explicitly use the Express middleware.
  • The experimental support for incremental delivery directives @defer and @stream (which requires using a pre-release version of graphql v17) now explicitly only works with version 17.0.0-alpha.2 of graphql. Note that this supports the same incremental delivery protocol implemented by Apollo Server 4, which is not the same protocol in the latest alpha version of graphql. As this support is experimental, we may switch over from "only alpha.2 is supported" to "only a newer alpha or final release is supported, with a different protocol" during the lifetime of Apollo Server 5.
  • Apollo Server is now compiled by the TypeScript compiler targeting the ES2023 standard rather than the ES2020 standard.
  • Apollo Server 5 responds to requests with variable coercion errors (eg, if a number is passed in the variables map for a variable declared in the operation as a String) with a 400 status code, indicating a client error. This is also the behavior of Apollo Server 3. Apollo Server 4 mistakenly responds to these requests with a 200 status code by default; we recommended the use of the status400ForVariableCoercionErrors: true option to restore the intended behavior. That option now defaults to true.
  • The unsafe precomputedNonce option to landing page plugins (which was only non-deprecated for 8 days) has been removed.
Patch Changes

There are a few other small changes in v5:

  • #​8076 5b26558 Thanks @​valters! - Fix some error logs to properly call logger.error or logger.warn with this set. This fixes errors or crashes from logger implementations that expect this to be set properly in their methods.

  • #​7515 100233a Thanks @​trevor-scheer! - ApolloServerPluginSubscriptionCallback now takes a fetcher argument, like the usage and schema reporting plugins. The default value is Node's built-in fetch.

  • Updated dependencies [100233a]:


Configuration

📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

👻 Immortal: This PR will be recreated if closed unmerged. Get config help if that's undesired.


  • If you want to rebase/retry this PR, check this box

This PR was generated by Mend Renovate. View the repository job log.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jul 17, 2025

Important

Review skipped

Bot user detected.

To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.


Comment @coderabbitai help to get the list of available commands and usage tips.

@renovate renovate bot force-pushed the renovate/major-apollo-graphql-packages branch 5 times, most recently from e417abc to 50fbac9 Compare July 25, 2025 19:14
@renovate renovate bot force-pushed the renovate/major-apollo-graphql-packages branch from 50fbac9 to 623752b Compare July 28, 2025 15:13
@renovate renovate bot force-pushed the renovate/major-apollo-graphql-packages branch 4 times, most recently from 5073e7f to 62d3829 Compare August 13, 2025 14:19
@renovate renovate bot force-pushed the renovate/major-apollo-graphql-packages branch 2 times, most recently from e5cff25 to 0a58a36 Compare August 21, 2025 23:33
@renovate renovate bot changed the title fix(deps): update dependency @apollo/server to v5 fix(deps): update apollo graphql packages (major) Aug 21, 2025
@renovate renovate bot force-pushed the renovate/major-apollo-graphql-packages branch 5 times, most recently from ad96144 to 3264554 Compare August 31, 2025 10:15
@renovate renovate bot force-pushed the renovate/major-apollo-graphql-packages branch 3 times, most recently from 07199b1 to cfa6bb4 Compare September 8, 2025 15:09
@renovate renovate bot force-pushed the renovate/major-apollo-graphql-packages branch 4 times, most recently from c8225bc to 0b32917 Compare September 14, 2025 19:22
@renovate renovate bot force-pushed the renovate/major-apollo-graphql-packages branch 9 times, most recently from 0b9f157 to cd4cdcf Compare October 2, 2025 15:10
@renovate renovate bot force-pushed the renovate/major-apollo-graphql-packages branch 2 times, most recently from dc8427f to cb159de Compare October 13, 2025 21:02
@renovate renovate bot force-pushed the renovate/major-apollo-graphql-packages branch 2 times, most recently from 7ff4772 to dd9a88b Compare October 27, 2025 18:12
@renovate renovate bot force-pushed the renovate/major-apollo-graphql-packages branch 2 times, most recently from 183427c to 4c76cba Compare October 31, 2025 19:06
@renovate renovate bot force-pushed the renovate/major-apollo-graphql-packages branch 2 times, most recently from 9f798ce to 88d3436 Compare November 10, 2025 15:53
@renovate renovate bot force-pushed the renovate/major-apollo-graphql-packages branch 2 times, most recently from 3bcebc2 to 66bb0ed Compare November 21, 2025 23:58
@renovate renovate bot force-pushed the renovate/major-apollo-graphql-packages branch 2 times, most recently from 6fedea6 to 4061d0f Compare December 10, 2025 09:16
@renovate renovate bot force-pushed the renovate/major-apollo-graphql-packages branch 3 times, most recently from 9dd5a3c to 8d80431 Compare December 16, 2025 20:52
@renovate renovate bot force-pushed the renovate/major-apollo-graphql-packages branch from 8d80431 to 85b947d Compare December 31, 2025 14:40
@renovate renovate bot force-pushed the renovate/major-apollo-graphql-packages branch 3 times, most recently from 5e0f4fb to 81b2b44 Compare January 13, 2026 21:55
@renovate renovate bot force-pushed the renovate/major-apollo-graphql-packages branch from 81b2b44 to fe4802a Compare January 16, 2026 00:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant