Releases: apollographql/react-apollo
2.5.8
2.5.7
2.5.7 (2019-06-21)
Improvements
- Make sure
MockedProvideris using the proper CJS/ESM bundle, when
referencingApolloProvider.
@jure in #3029. - Adjust the
ApolloContextdefinition to play a bit more nicely with
React.createContexttypes.
@JoviDeCroock in #3018 - The result of a mutation is now made available to the wrapped component,
when using thegraphqlHOC.
@andycarrell in #3008 - Check equality of stringified variables in the
MockLinkto improve
debugging experience used byMockedProvider.
@evans in #3078
Bug Fixes
- Removed leftover
apollo-client@betapeer dep.
@brentertz in #3064 - Stop setting optional input to
null, when using thegraphqlHOC.
@ZhengYuTay in #3056 - Fix typescript error caused by
querybeing mandatory in thefetchMore
signature.
@HsuTing in #3065 - Fixes an issue that caused the
Querycomponent to get stuck in an always
loading state, caused by receiving an error (meaning subsequent valid
responses couldn't be handled). TheQuerycomponent can now handle an
error in a response, then continue to handle a valid response afterwards.
@hwillson in #3107 - Reorder
Subscriptioncomponent code to avoid setting state on unmounted
component.
@jasonpaulos in #3139 - Fix component stuck in
loadingstate fornetwork-onlyfetch policy.
@jasonpaulos in #3126
2.5.5
2.5.4
Bug Fixes
- Fixes
Could not find "client" in the context of ApolloConsumererrors when
usingMockedProvider.
@hwillson in #2907 - Ensure
Querycomponents using afetchPolicyofno-cachehave 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
setStatein the
onError/onCompletedcallbacks of theQuerycomponent.
@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
Querycomponent updates from firing (under
certain circumstances) due to the internallastResultvalue (that's used
to help prevent unnecessary re-renders) not being updated.
@Glennrs in #2840
Improvements
-
MockedProvidernow accepts achildPropsprop that can be used to pass
props down to a child component.
@miachenmtl in #2482 -
onCompletedcallbacks now use a destructuring-friendly type definition.
@jozanza in #2496 -
@connectiondirectives are now properly stripped fromMockedResponse's,
when usingMockedProvider.
@ajmath in #2523 -
MockedProviderhas 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
@clientfields 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 theMockedProviderresolversprop.
@ajmath in #2524 -
Improvements to the
graphqlHOC generics forfetchMoreandrefetch.
@EricMcRay in #2525 -
The
ApolloProvider/ApolloConsumerimplementations have been refactored
to use React 16.3's new context API.
@wzrdzl in #2540 -
All
dependenciesanddevDependencieshave 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
MockedResponseresultwhen 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/onErroreven ifMutationunmounts.
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#stopmethod to dispose ofMockedProviderclient
instance.
PR #2741 -
The
apollo-clientpeer 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-clientversion
requirement.
2.2.4
2.2.4 (October 2, 2018)
Bug Fixes
lodash.isequalwas improperly set as a dev dependency for
MockLink/MockedProvider. It is now a dependency.
@danilobuerger in #2449
Improvements
- The
Subscriptioncomponent now accepts afetchPolicyprop.
@MatthieuLemoine in #2298
Typescript
- Make sure the
TVariablesgeneric 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 defaulterrorPolicyofall.
@amacleay in #2374 <Mutation />refetchQueriestriggered by name (string) will now use the correct variables.
@fracmal in #2422
Improvements
- Replace the
lodashdependency withlodash.flowright(since that's the
only non-devlodashfunction we're dependent on). Devlodash
dependencies have also been updated to use their individual module
equivalent.
@hwillson in #2435 - Removed
rollup-plugin-babel-minifyas it's no longer being used.
@hwillson in #2436 - Small
getDataFromTree.tslogic adjustment to avoid unnecessary calls
when a falsyelementis encountered.
@HOUCe in #2429 graphql14 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
lodashtypings.
@williamboman in #2430 - Typings: added
contexttoMutationOptions.
@danilobuerger in #2354 - Typings: more
MutationOptionschanges/fixes.
@danilobuerger in #2340 - Remove
allowSyntheticDefaultImportsuse. Typescript's
allowSyntheticDefaultImportscompiler 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'ses2015moduleoption, which means
allowSyntheticDefaultImportshas to be enabled explicitly. We've
switched back to using a combination ofimport * as Xandrequire
syntax, to work with default imports. We'll re-introduce
allowSyntheticDefaultImportsuse in React Apollo 3.
@hwillson in #2438