All Versions
172
Latest Version
Avg Release Cycle
34 days
Latest Release
1053 days ago
Changelog History
Page 4
Changelog History
Page 4
-
v2.3.2 Changes
๐ Improvements
๐ Bug Fixes
- ๐ฆ This package no longer imports
react-dom/server
unconditionally at the top level, makingreact-apollo
safer to use in environments like React Native that are neither browser-like nor Node-like, and thus struggle to importreact-dom/server
and its dependencies. Additionally, the React Native bundler has been instructed to ignore allreact-dom/server
dependencies withinreact-apollo
, soreact-dom
will not be bundled in React Native apps simply because they importreact-apollo
. PR #2627
- ๐ฆ This package no longer imports
-
v2.3.1 Changes
November 15, 2018๐ Improvements
- โช Restore original
getDataFromTree(tree, context)
API, and introduce a new alternative calledgetMarkupFromTree
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> {...}
๐ Bug Fixes
- ๐ Version 2.3.0 was published incorrectly, breaking nested
react-apollo/...
imports. This problem was fixed in version 2.3.1 by runningnpm publish
from thelib/
directory, as intended. Issue #2591
- โช Restore original
-
v2.3.0 Changes
๐ Bug Fixes
- ๐ Fix
networkStatus
to reflect the loading state correctly for partial refetching. @steelbrain in #2493
๐ Improvements
- Reimplement
getDataFromTree
usingReactDOM.renderToStaticMarkup
to make asynchronous server-side rendering compatible with React hooks. Although the rendering function used bygetDataFromTree
defaults torenderToStaticMarkup
, any suitable rendering function can be passed as the optional second argument togetDataFromTree
, which now returns aPromise<string>
that resolves to The HTML rendered in the final pass, which means callingrenderToString
aftergetDataFromTree
may not be necessary anymore. PR #2533
- ๐ Fix
-
v2.2.4 Changes
October 02, 2018๐ Bug Fixes
lodash.isequal
was improperly set as a dev dependency forMockLink
/MockedProvider
. It is now a dependency. @danilobuerger in #2449
๐ Improvements
- The
Subscription
component now accepts afetchPolicy
prop. @MatthieuLemoine in #2298
Typescript
- ๐ Make sure the
TVariables
generic is passed toObservableQuery
. @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
ofall
. @amacleay in #2374 <Mutation />
refetchQueries
triggered by name (string) will now use the correct variables. @fracmal in #2422
๐ Improvements
- Replace the
lodash
dependency withlodash.flowright
(since that's the only non-devlodash
function we're dependent on). Devlodash
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 falsyelement
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
toMutationOptions
. @danilobuerger in #2354 - ๐ Typings: more
MutationOptions
changes/fixes. @danilobuerger in #2340 - โ Remove
allowSyntheticDefaultImports
use. Typescript'sallowSyntheticDefaultImports
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 localtsconfig.json
, to be able to handle default imports properly. This is because we're also using Typescript'ses2015
module
option, which meansallowSyntheticDefaultImports
has to be enabled explicitly. We've switched back to using a combination ofimport * as X
andrequire
syntax, to work with default imports. We'll re-introduceallowSyntheticDefaultImports
use in React Apollo 3. @hwillson in #2438
- Mutation errors are now properly returned as a render prop, when using
a default
-
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 asundefined
. This behavior has been changed so thatdata
is returned as an empty object. This makes checking for data (e.g. instead ofdata && data.user
you can just checkdata.user
) and destructring (e.g.{ data: { user } }
) easier. Note: this could potentially hurt applications that are relying on a falsey check ofdata
to see if any query errors have occurred. A better (and supported) way to check for errors is to use the resulterrors
property. #1983
- When using
-
v2.2.1 Changes
September 26, 2018- โช Revert: "Typescript: use
Partial<TData>
instead ofTData | {}
, for theQueryResult
data
property."
- โช Revert: "Typescript: use
-
v2.2.0 Changes
September 26, 2018- ๐ Improved TypeScript Typings:
Deprecated
MutationFunc
in favor ofMutationFn
. Added missingonCompleted
andonError
callbacks toMutationOpts
. @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 callbackoptions
object param consists of the current Apollo Client instance inclient
, and the received subscription data insubscriptionData
. @jedwards1211 in #1966 - The
graphql
options
object is no longer mutated, when calculating variables from props. This now prevents an issue where components created withgraphql
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 asundefined
. This behavior has been changed so thatdata
is returned as an empty object. This makes checking for data (e.g. instead ofdata && data.user
you can just checkdata.user
) and destructring (e.g.{ data: { user } }
) easier. Note: this could potentially hurt applications that are relying on a falsey check ofdata
to see if any query errors have occurred. A better (and supported) way to check for errors is to use the resulterrors
property. @TLadd in #1983 - ๐ Allow a custom
cache
object to be passed into the test-utilsMockedProvider
. @palmfjord in #2254 - ๐คก Make the
MockedProvider
mocks
prop read only. @amacleay in #2284 - โ Remove duplicate
FetchMoreOptions
andFetchMoreQueryOptions
types, and instead import them from Apollo Client. @skovy in #2281 - Type changes for the
graphql
HOCoptions.skip
property. @jameslaneconkling in #2208 - Avoid importing
lodash
directly. @shahyar in #2045 - When the
Query
skip
prop is set totrue
, make sure the render proploading
param is set tofalse
, 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 thecontext
or via props. @quentin- in #1956 - Typescript: use
Partial<TData>
instead ofTData | {}
, for theQueryResult
data
property. @tgriesser in #2313 - Adjust
<Query />
onCompleted
andonError
callbacks to be triggered via thecomponentDidUpdate
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 ingraphql
HOCoptions
were not merged with mutationvariables
. @samginn in #2216 - โ Added a new
partialRefetch
prop (false
by default). When aQuery
component is mounted, and a mutation is executed that returns the same ID as the mountedQuery
, but has less fields in its result, Apollo Client'sQueryManager
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 originalQuery
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 mutationsupdate
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 thepartialRefetch
prop can be used to automaticallyrefetch
the original query and update the cache. @steelbrain in #2003
- ๐ Improved TypeScript Typings:
Deprecated
-
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 andgraphql
HOC to accept a newawaitRefetchQueries
prop (boolean). When set totrue
, queries specified inrefetchQueries
will be completed before the mutation itself is completed.awaitRefetchQueries
isfalse
by default, which meansrefetchQueries
are usually completed after the mutation has resolved. Relates to Apollo Client. PR #3169. @hwillson in #2214 - โก๏ธ Typings adjustment: pass
TData
along intoMutationUpdaterFn
when usingMutationOpts
, to ensure that the updater function is properly typed. @danilobuerger in #2227 - Check if queryManager is set before accessing it. @danilobuerger in #2165
- ๐ Fixed an issue in
-
v2.1.9 Changes
July 04, 2018- โ Added
onCompleted
andonError
props to theQuery
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
- โ Added