github apollographql/apollo-client @apollo/client@4.1.0-alpha.2

pre-release19 hours ago

Minor Changes

  • #12959 556e837 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 }),
        });
      }
    
      // ...
    }

Patch Changes

  • #12954 1c82eaf Thanks @jerelmiller! - Ensure an error is thrown when @stream is detected and an incrementalDelivery handler is not configured.

Don't miss a new apollo-client release

NewReleases is sending notifications on new releases.