github apollographql/apollo-client @apollo/client@4.2.0-alpha.7

pre-release7 hours ago

Minor Changes

  • #13222 b93c172 Thanks @jerelmiller! - Extend the defaultOptions type-safety work to preloadQuery (returned from createQueryPreloader). Defaults declared in DeclareDefaultOptions.WatchQuery now work with preloadQuery to ensure the PreloadedQueryRef's data states are correctly set.

    // apollo.d.ts
    import "@apollo/client";
    
    declare module "@apollo/client" {
      namespace ApolloClient {
        namespace DeclareDefaultOptions {
          interface WatchQuery {
            errorPolicy: "all";
          }
        }
      }
    }
    const preloadQuery = createQueryPreloader(client);
    const queryRef = preloadQuery(QUERY);
    //    ^? PreloadedQueryRef<TData, TVariables, "complete" | "streaming" | "empty">

Don't miss a new apollo-client release

NewReleases is sending notifications on new releases.