Releases: apollographql/react-apollo
2.5.8
2.5.7
2.5.7 (2019-06-21)
Improvements
- Make sure
MockedProvider
is using the proper CJS/ESM bundle, when
referencingApolloProvider
.
@jure in #3029. - Adjust the
ApolloContext
definition to play a bit more nicely with
React.createContext
types.
@JoviDeCroock in #3018 - The result of a mutation is now made available to the wrapped component,
when using thegraphql
HOC.
@andycarrell in #3008 - Check equality of stringified variables in the
MockLink
to improve
debugging experience used byMockedProvider
.
@evans in #3078
Bug Fixes
- Removed leftover
apollo-client@beta
peer dep.
@brentertz in #3064 - Stop setting optional input to
null
, when using thegraphql
HOC.
@ZhengYuTay in #3056 - Fix typescript error caused by
query
being mandatory in thefetchMore
signature.
@HsuTing in #3065 - Fixes an issue that caused the
Query
component to get stuck in an always
loading state, caused by receiving an error (meaning subsequent valid
responses couldn't be handled). TheQuery
component can now handle an
error in a response, then continue to handle a valid response afterwards.
@hwillson in #3107 - Reorder
Subscription
component code to avoid setting state on unmounted
component.
@jasonpaulos in #3139 - Fix component stuck in
loading
state fornetwork-only
fetch policy.
@jasonpaulos in #3126
2.5.5
2.5.4
Bug Fixes
- Fixes
Could not find "client" in the context of ApolloConsumer
errors when
usingMockedProvider
.
@hwillson in #2907 - Ensure
Query
components using afetchPolicy
ofno-cache
have their
data preserved when the components tree is re-rendered.
@hwillson in #2914
Improvements
- Documentation updates.
@afenton90 in #2932
2.5.3
2.5.3
Bug Fixes
- Fixed an infinite loop caused by using
setState
in the
onError
/onCompleted
callbacks of theQuery
component.
@chenesan in #2751 - Fixed an issue that prevented good results from showing up in a
Query
component, after an error was received, variables were adjusted, and then
the good data was fetched.
@MerzDaniel in #2718 - Fixed an issue that prevented
Query
component updates from firing (under
certain circumstances) due to the internallastResult
value (that's used
to help prevent unnecessary re-renders) not being updated.
@Glennrs in #2840
Improvements
-
MockedProvider
now accepts achildProps
prop that can be used to pass
props down to a child component.
@miachenmtl in #2482 -
onCompleted
callbacks now use a destructuring-friendly type definition.
@jozanza in #2496 -
@connection
directives are now properly stripped fromMockedResponse
's,
when usingMockedProvider
.
@ajmath in #2523 -
MockedProvider
has been updated to stop setting a defaultresolvers
value of{}
, which means by default Apollo Client 2.5 local resolver
functionality is not enabled when mocking withMockedProvider
. This allows
@client
fields to be passed through the mocked link chain, like people
were used to before AC 2.5. When using this default mode you will see a
dev only warning message about this like:Found @client directives in query but no client resolvers were specified.
You can now pass apollo-link-state resolvers to the ApolloClient
constructor.This message can be safely ignored. If you want to use
MockedProvider
with AC 2.5's new local resolver functionality, you can pass your local
resolver map into theMockedProvider
resolvers
prop.
@ajmath in #2524 -
Improvements to the
graphql
HOC generics forfetchMore
andrefetch
.
@EricMcRay in #2525 -
The
ApolloProvider
/ApolloConsumer
implementations have been refactored
to use React 16.3's new context API.
@wzrdzl in #2540 -
All
dependencies
anddevDependencies
have been updated to their latest
versions, and related Typescript changes have been applied.
@hwillson in #2873
2.5.1
2.5.0
2.5.0
Improvements
- Ready to be used with Apollo Client 2.5 and its new local state management features, as well as many overall code improvements to help reduce the React Apollo bundle size.
#2758 - A function can now be set as a
MockedResponse
result
when usingMockedProvider
, such that every time the mocked result is returned, the function is run to calculate the result. This opens up new testing possibilities, like being able to verify if a mocked result was actually requested and received by a test.
@hwillson in #2788
2.4.0
2.4.0
Bug Fixes
- Invoke
onCompleted
/onError
even ifMutation
unmounts.
PR #2710
Improvements
-
Update the typescript example app to use the raw Query component directly,
with generics, to avoid generating the extra object that's created (in the
compiled code) when extending the Query component as a class.
@evans in #2721 -
Use new
ApolloClient#stop
method to dispose ofMockedProvider
client
instance.
PR #2741 -
The
apollo-client
peer dependency version constraint has been updated
to require the latest version, 2.4.12. Although this update is
recommended, and we believe it is backwards compatible with other
[email protected] versions, we decided to bump the minor version of
react-apollo
(to 2.4.0) because of this newapollo-client
version
requirement.
2.2.4
2.2.4 (October 2, 2018)
Bug Fixes
lodash.isequal
was improperly set as a dev dependency for
MockLink
/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
2.2.3
2.2.3 (September 30, 2018)
Bug Fixes
- Mutation errors are now properly returned as a render prop, when using
a defaulterrorPolicy
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's
allowSyntheticDefaultImports
compiler option is something we'd like to
start using, but we jumped the gun a bit by introducing it in
9a96519.
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 means
allowSyntheticDefaultImports
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-introduce
allowSyntheticDefaultImports
use in React Apollo 3.
@hwillson in #2438