All Versions
172
Latest Version
Avg Release Cycle
34 days
Latest Release
463 days ago

Changelog History
Page 4

  • v2.3.2 Changes

    ๐Ÿ‘Œ Improvements

    ๐Ÿ› Bug Fixes

    • ๐Ÿ“ฆ This package no longer imports react-dom/server unconditionally at the top level, making react-apollo safer to use in environments like React Native that are neither browser-like nor Node-like, and thus struggle to import react-dom/server and its dependencies. Additionally, the React Native bundler has been instructed to ignore all react-dom/server dependencies within react-apollo, so react-dom will not be bundled in React Native apps simply because they import react-apollo. PR #2627
  • v2.3.1 Changes

    November 15, 2018

    ๐Ÿ‘Œ Improvements

    • โช Restore original getDataFromTree(tree, context) API, and introduce a new alternative called getMarkupFromTree to enable custom rendering functions:
      export default function getDataFromTree(
        tree: React.ReactNode,
        context: { [key: string]: any } = {},
      ) {
        return getMarkupFromTree({
          tree,
          context,
          renderFunction: renderToStaticMarkup,
        });
      }
    
      export type GetMarkupFromTreeOptions = {
        tree: React.ReactNode;
        context?: { [key: string]: any };
        renderFunction?: typeof renderToStaticMarkup;
      };
    
      export function getMarkupFromTree({
        tree,
        context = {},
        renderFunction = renderToStaticMarkup,
      }: GetMarkupFromTreeOptions): Promise<string> {...}
    

    PR #2586

    ๐Ÿ› Bug Fixes

    • ๐Ÿ”– Version 2.3.0 was published incorrectly, breaking nested react-apollo/... imports. This problem was fixed in version 2.3.1 by running npm publish from the lib/ directory, as intended. Issue #2591
  • v2.3.0 Changes

    ๐Ÿ› Bug Fixes

    • ๐Ÿ›  Fix networkStatus to reflect the loading state correctly for partial refetching. @steelbrain in #2493

    ๐Ÿ‘Œ Improvements

    • Reimplement getDataFromTree using ReactDOM.renderToStaticMarkup to make asynchronous server-side rendering compatible with React hooks. Although the rendering function used by getDataFromTree defaults to renderToStaticMarkup, any suitable rendering function can be passed as the optional second argument to getDataFromTree, which now returns a Promise<string> that resolves to The HTML rendered in the final pass, which means calling renderToString after getDataFromTree may not be necessary anymore. PR #2533
  • v2.2.4 Changes

    October 02, 2018

    ๐Ÿ› Bug Fixes

    • lodash.isequal was improperly set as a dev dependency for MockLink / MockedProvider. It is now a dependency. @danilobuerger in #2449

    ๐Ÿ‘Œ Improvements

    Typescript

    • ๐Ÿ‘‰ Make sure the TVariables generic is passed to ObservableQuery. @tgriesser in #2311
  • v2.2.3 Changes

    September 30, 2018

    ๐Ÿ› Bug Fixes

    • Mutation errors are now properly returned as a render prop, when using a default errorPolicy of all. @amacleay in #2374
    • <Mutation /> refetchQueries triggered by name (string) will now use the correct variables. @fracmal in #2422

    ๐Ÿ‘Œ Improvements

    • Replace the lodash dependency with lodash.flowright (since that's the only non-dev lodash function we're dependent on). Dev lodash dependencies have also been updated to use their individual module equivalent. @hwillson in #2435
    • โœ‚ Removed rollup-plugin-babel-minify as it's no longer being used. @hwillson in #2436
    • Small getDataFromTree.ts logic adjustment to avoid unnecessary calls when a falsy element is encountered. @HOUCe in #2429
    • โšก๏ธ graphql 14 updates. @hwillson in #2437
    • โšก๏ธ All example apps (included in the repo) have been updated to work with the latest version of React Apollo. @hwillson in #2439

    Typescript

    • ๐Ÿ›  Fix lodash typings. @williamboman in #2430
    • Typings: added context to MutationOptions. @danilobuerger in #2354
    • ๐Ÿ›  Typings: more MutationOptions changes/fixes. @danilobuerger in #2340
    • โœ‚ Remove allowSyntheticDefaultImports use. Typescript's allowSyntheticDefaultImports compiler option is something we'd like to start using, but we jumped the gun a bit by introducing it in https://github.com/apollographql/react-apollo/commit/9a96519d390783dfd9a431dc2dbaa476a24f7b80. Including it means that anyone who wants to use Typescript with React Apollo would have to also include it in their own local tsconfig.json, to be able to handle default imports properly. This is because we're also using Typescript's es2015 module option, which means allowSyntheticDefaultImports has to be enabled explicitly. We've switched back to using a combination of import * as X and require syntax, to work with default imports. We'll re-introduce allowSyntheticDefaultImports use in React Apollo 3. @hwillson in #2438
  • v2.2.2 Changes

    September 28, 2018
    • When using React.createContext and SSR, we now make sure the context provider value is reset to the previous value it had after its children are walked. @mitchellhamilton in #2304
    • โช Revert: When a query failed on the first result, the query result data was being returned as undefined. This behavior has been changed so that data is returned as an empty object. This makes checking for data (e.g. instead of data && data.user you can just check data.user) and destructring (e.g. { data: { user } }) easier. Note: this could potentially hurt applications that are relying on a falsey check of data to see if any query errors have occurred. A better (and supported) way to check for errors is to use the result errors property. #1983
  • v2.2.1 Changes

    September 26, 2018
    • โช Revert: "Typescript: use Partial<TData> instead of TData | {}, for the QueryResult data property."
  • v2.2.0 Changes

    September 26, 2018
    • ๐Ÿ‘Œ Improved TypeScript Typings: Deprecated MutationFunc in favor of MutationFn. Added missing onCompleted and onError callbacks to MutationOpts. @danilobuerger in #2322
    • โž• Added an example app that shows how to test mutations. @excitement-engineer in #1998
    • The <Subscription /> component now allows the registration of a callback function, that will be triggered each time the component receives data. The callback options object param consists of the current Apollo Client instance in client, and the received subscription data in subscriptionData. @jedwards1211 in #1966
    • The graphql options object is no longer mutated, when calculating variables from props. This now prevents an issue where components created with graphql were not having their query variables updated properly, when props changed. @ksmth in #1968
    • When a query failed on the first result, the query result data was being returned as undefined. This behavior has been changed so that data is returned as an empty object. This makes checking for data (e.g. instead of data && data.user you can just check data.user) and destructring (e.g. { data: { user } }) easier. Note: this could potentially hurt applications that are relying on a falsey check of data to see if any query errors have occurred. A better (and supported) way to check for errors is to use the result errors property. @TLadd in #1983
    • ๐Ÿ‘ Allow a custom cache object to be passed into the test-utils MockedProvider. @palmfjord in #2254
    • ๐Ÿคก Make the MockedProvider mocks prop read only. @amacleay in #2284
    • โœ‚ Remove duplicate FetchMoreOptions and FetchMoreQueryOptions types, and instead import them from Apollo Client. @skovy in #2281
    • Type changes for the graphql HOC options.skip property. @jameslaneconkling in #2208
    • Avoid importing lodash directly. @shahyar in #2045
    • When the Query skip prop is set to true, make sure the render prop loading param is set to false, since we're not actually loading anything. @edorivai in #1916
    • ๐Ÿ— No longer building against Node 9 @hwillson in #2404
    • ๐Ÿ‘‰ Make sure <Subscription />, <Query /> & <Mutation /> all support using an Apollo Client instance configured in the context or via props. @quentin- in #1956
    • Typescript: use Partial<TData> instead of TData | {}, for the QueryResult data property. @tgriesser in #2313
    • Adjust <Query /> onCompleted and onError callbacks to be triggered via the componentDidUpdate lifecycle method. This ensures these callbacks can be used when data is fetched over the network, and when data is fetched from the local store (previsouly these callbacks were only being triggered when data was fetched over the network). @olistic in #2190
    • Import lodash/flowRight using ES import to allow for treeshaking. @Pajn in #2332
    • ๐Ÿ›  Fixed a regression where variables passed in graphql HOC options were not merged with mutation variables. @samginn in #2216
    • โž• Added a new partialRefetch prop (false by default). When a Query component is mounted, and a mutation is executed that returns the same ID as the mounted Query, but has less fields in its result, Apollo Client's QueryManager returns the data as an empty Object since a hit can't be found in the cache. This can lead to application errors when the UI elements rendered by the original Query component are expecting certain data values to exist, and they're all of a sudden stripped away. The recommended way to handle this is to use the mutations update prop to reconcile the mutation result with the data in the cache, getting everything into the expected state. This can definitely be a cumbersome process however, so to help address this the partialRefetch prop can be used to automatically refetch the original query and update the cache. @steelbrain in #2003
  • v2.1.11 Changes

    August 09, 2018
    • ๐Ÿ›  Fixed an issue in getDataFromTree where queries that threw more than one error had error messages swallowed, and returned an invalid error object with circular references. Multiple errors are now preserved. @anand-sundaram-zocdoc in #2133
    • โšก๏ธ Update both the <Mutation /> component and graphql HOC to accept a new awaitRefetchQueries prop (boolean). When set to true, queries specified in refetchQueries will be completed before the mutation itself is completed. awaitRefetchQueries is false by default, which means refetchQueries are usually completed after the mutation has resolved. Relates to Apollo Client. PR #3169. @hwillson in #2214
    • โšก๏ธ Typings adjustment: pass TData along into MutationUpdaterFn when using MutationOpts, to ensure that the updater function is properly typed. @danilobuerger in #2227
    • Check if queryManager is set before accessing it. @danilobuerger in #2165
  • v2.1.9 Changes

    July 04, 2018
    • โž• Added onCompleted and onError props to the Query component, than can be used to register callback functions that are to be executed after a query successfully completes, or an error occurs. @jeshep in #1922
    • โž• Add UNSAFE_componentWillMount SSR support. @leops in #2152
    • โฑ Clear out scheduler on MockedProvider unmount. @danilobuerger in #2151