-
Notifications
You must be signed in to change notification settings - Fork 16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(deps): update dependency react-apollo to v3 #49
base: master
Are you sure you want to change the base?
Conversation
|
d5a5243
to
c8d0758
Compare
c8d0758
to
0abd66c
Compare
0abd66c
to
0ac6036
Compare
0ac6036
to
69f7f15
Compare
⚠ Artifact update problemRenovate failed to update an artifact related to this branch. You probably do not want to merge this PR as-is. ♻ Renovate will retry this branch, including artifacts, only when one of the following happens:
The artifact failure details are included below: File name: package-lock.json
|
69f7f15
to
31c778b
Compare
This PR contains the following updates:
^2.1.4
->^3.0.0
Release Notes
apollographql/react-apollo (react-apollo)
v3.1.5
Compare Source
v3.1.4
Compare Source
v3.1.3
Compare Source
onCompleted
being called more often than necessary.@hwillson in 0901f4a
v3.1.2
Compare Source
Bug Fixes
ssr: false
andssrMode: true
.@maapteh in #3515
MockLink
's brokennewData
function handling.@pawelkleczek in #3539
networkStatus
from changingready
at the end of pagination.@mu29 in #3514
v3.1.1
Compare Source
Improvements
startPolling
orstopPolling
after a component has unmounted is now a no-op (instead of throwing an exception). Polling is automatically stopped when a component is unmounted, so it doesn't need to be called manually.@hwillson in #3485
ignoreResults
to be controlled throughgraphql
andwithMutation
options.@tim-stasse in #3431
ObservableQuery
instance, to avoid attempting to use it after a componenthas unmounted.
@jfrolich in #3490
Bug Fixes
loading
state when an error occurs after a refetch, that is the same as the previous error.@jet2jet in #3477
ChildDataProps
andChildMutateProps
types.@hwillson in #3495
onCompleted
is called each time auseLazyQuery
based query completes, after the execution function is called.@hwillson in #3497
v3.1.0
Compare Source
Potentially Breaking Change
data
state from{}
toundefined
. This change aligns all parts of the React Apollo query cycle so thatdata
is alwaysundefined
if there is no data, instead ofdata
being converted into an empty object. This change impacts the initial query response, initial SSR response,data
value when errors occur,data
value when skipping, etc. All of these areas are now aligned to only ever return a value fordata
if there really is a value to return (instead of making it seem like there is one by converting to{}
).@hwillson in #3388
Bug Fixes
skip
option when usinguseSubscription
.@n1ru4l in #3356
refetch
,fetchMore
,updateQuery
,startPolling
,stopPolling
, andsubscribeToMore
maintain a stable identity when they're passed back alongside query results.@hwillson in #3422
fetchMore.updateQuery
withnotifyOnNetworkStatusChange
set to true. WhennotifyOnNetworkStatusChange
is true, re-renders will now wait untilupdateQuery
has completed, to make sure the updated data is used during the render.@hwillson in #3433
client
to theuseMutation
result.@joshalling in #3417
onError
andonCompleted
callbacks from being part of the internal memoization that's used to decide when certain after render units of functionality are run, when usinguseQuery
. This fixes issues related to un-necessary component cleanup, likeerror
disappearing from results when it should be present.@dylanwulf in #3419
useLazyQuery
's execution function can now be called multiple times in a row, and will properly submit network requests each time called, when using a fetch policy ofnetwork-only
.@hwillson in #3453
network-only
andcache-and-network
fetch policies, along with changes to ensure disabled SSR queries are not fired.@mikebm in #3435
void
from theMutationFunction
's returned Promise types.@hwillson in #3458
onCompleted
calls during the same query execution cycle.@hwillson in #3461
@dqunbp in #3273
@SeanRoberts in #3380
v3.0.1
Compare Source
Improvements
@joshalling in #3324
Bug Fixes
onError
callback calls and ensurerefetch
setsloading
state properly.@hwillson in #3339
useLazyQuery
export to thereact-apollo
(all) package.@hwillson in #3320
void
from being one of theMutationTuple
mutate function possible generics. This will make it easier to properly destructure results returned by the mutate function Promise.@hwillson in #3334
MockedProviderProps
andMockedProviderState
from@apollo/react-testing
.@hwillson in #3337
@types/react
as a peer dep, to address potential TS compilation errors when usingApolloProvider
.@zkochan in #3278
error
's are maintained after re-renders, when they should be.@hwillson in #3362
v3.0.0
Compare Source
Overview
This major release includes a large refactoring of the existing React Apollo codebase, to introduce new improvements, changes, features and bug fixes. The biggest new features are:
useQuery
,useLazyQuery
,useMutation
,useSubscription
, anduseApolloClient
hooks, following React's Hooks API.graphql
HOC and render proper components.@apollo/react-common
@apollo/react-hooks
@apollo/react-components
@apollo/react-hoc
@apollo/react-ssr
@apollo/react-testing
Consult the Hooks migration guide for more details around upgrading. For more information regarding how to use the new hooks, please consult the updated React Apollo docs (all docs have been updated to be hooks first).
Breaking Changes
The minimum supported React version is now 16.8.
The
react-apollo@3
package preserves most of the functionality ofreact-apollo@2
by re-exporting existing components and functions from@apollo/react-components
and@apollo/react-hoc
. If you want to use Hooks, Components, or HOC directly, import the new@apollo/react-hooks
,@apollo/react-components
, and/or@apollo/react-hoc
packages instead.React Apollo testing utilities are no longer available as part of the
react-apollo
package. They should now be imported from the new@apollo/react-testing
package.The deprecated
walkTree
function has been removed (9b24d756).The deprecated
GraphqlQueryControls
andMutationFunc
types have been removed (ade881f0).Preact is no longer supported (b742ae63).
Various Typescript type changes. Since we've introduced a third way of managing data with React (Hooks), we had to rework many of the existing exported types to better align with the Hooks way of doing things. Base types are used to hold common properties across Hooks, Components and the
graphql
HOC, and these types are then extended when needed to provide properties that are specific to a certain React paradigm(30edb1b0 and
3d138db3).
catchAsyncError
,wrap
, andcompose
utilities have been removed(2c3a262, 7de864e, and e6089a7).
Previously,
compose
was imported then exported directly from lodash usingflowRight
. To keep usingcompose
, install thelodash.flowright
package, then update yourcompose
imports as:Render prop components (
Query
,Mutation
andSubscription
) can no longer be extended. In other words, this is no longer possible:All class based render prop components have been converted to functional components, so they could then just wrap their hook based equivalents (
useQuery
,useMutation
,useSubscription
).While we recommend switching over to use the new hooks as soon as possible, if you're looking for a stop gap you can consider typing a
Query
component in a similar fashion, like:v2.5.8
Compare Source
2.5.8 (2019-06-21)
Bug Fixes
apollo-client
2.6.3'sObservableQuery.resetQueryStoreErrors
method optional, for people who can't update to
react-apollo
's newapollo-client
peer dep of 2.6.3.@hwillson in #3151
v2.5.7
Compare Source
Improvements
MockedProvider
is using the proper CJS/ESM bundle, whenreferencing
ApolloProvider
.@jure in #3029.
ApolloContext
definition to play a bit more nicely withReact.createContext
types.@JoviDeCroock in #3018
when using the
graphql
HOC.@andycarrell in #3008
MockLink
to improvedebugging experience used by
MockedProvider
.@evans in #3078
Bug Fixes
apollo-client@beta
peer dep.@brentertz in #3064
null
, when using thegraphql
HOC.@ZhengYuTay in #3056
query
being mandatory in thefetchMore
signature.@HsuTing in #3065
Query
component to get stuck in an alwaysloading state, caused by receiving an error (meaning subsequent valid
responses couldn't be handled). The
Query
component can now handle anerror in a response, then continue to handle a valid response afterwards.
@hwillson in #3107
Subscription
component code to avoid setting state on unmountedcomponent.
@jasonpaulos in #3139
loading
state fornetwork-only
fetch policy.@jasonpaulos in #3126
v2.5.6
Compare Source
Improvements
Both the
Query
component andgraphql
HOC now accept areturnPartialData
prop. This is an important new feature, that shouldhelp address a lot of open Apollo Client / React Apollo issues, so we'll
explain it here with an example. Before this release, if you run a query
that looks like:
in one component, the results are cached, then you run a superset query like
the following in another component:
Apollo Client will not re-use the partial data that was cached from the first
query, when it preps and displays the second component. It can't find a
cache hit for the full second query, so it fires the full query over the
network.
With this release, if you set a
returnPartialData
prop totrue
on thesecond component, the
data
available to that component will beautomatically pre-loaded with the parts of the query that can be found in the
cache, before the full query is fired over the network. This means you can
do things like showing partial data in your components, while the rest of the
data is being loaded over the network.
v2.5.5
Compare Source
Improvements
ApolloContext
).@MrLoh in #2961
v2.5.4
Compare Source
Bug Fixes
Could not find "client" in the context of ApolloConsumer
errors whenusing
MockedProvider
.@hwillson in #2907
Query
components using afetchPolicy
ofno-cache
have theirdata preserved when the components tree is re-rendered.
@hwillson in #2914
Improvements
@afenton90 in #2932
v2.5.3
Compare Source
Bug Fixes
setState
in theonError
/onCompleted
callbacks of theQuery
component.@chenesan in #2751
Query
component, after an error was received, variables were adjusted, and then
the good data was fetched.
@MerzDaniel in #2718
Query
component updates from firing (undercertain circumstances) due to the internal
lastResult
value (that's usedto help prevent unnecessary re-renders) not being updated.
@Glennrs in #2840
Improvements
MockedProvider
now accepts achildProps
prop that can be used to passprops 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 using
MockedProvider
.@ajmath in #2523
MockedProvider
has been updated to stop setting a defaultresolvers
value of
{}
, which means by default Apollo Client 2.5 local resolverfunctionality is not enabled when mocking with
MockedProvider
. This allows@client
fields to be passed through the mocked link chain, like peoplewere used to before AC 2.5. When using this default mode you will see a
dev only warning message about this like:
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 the
MockedProvider
resolvers
prop.@ajmath in #2524
Improvements to the
graphql
HOC generics forfetchMore
andrefetch
.@EricMcRay in #2525
The
ApolloProvider
/ApolloConsumer
implementations have been refactoredto use React 16.3's new context API.
@wzrdzl in #2540
All
dependencies
anddevDependencies
have been updated to their latestversions, and related Typescript changes have been applied.
@hwillson in #2873
v2.5.2
Compare Source
Bug Fixes
Context
type fromtypes.ts
instead ofwalkTree.ts
,to reenable
import { Context } from 'react-apollo'
(which has beenbroken since 2.4.0).
@benjamn in #2825
Improvements
Add
examples/rollup
to enable application-level bundle measurement and demonstrate Rollup configuration best practices.
@benjamn in #2839
Bundle size reductions inspired by
examples/rollup
app.@benjamn in #2842
v2.5.1
Compare Source
Bug Fixes
MockedProvider
enables Apollo Client 2.5's local state handling,and allow custom / mocked resolvers to be passed in as props, and used with
the created test
ApolloClient
instance.@hwillson in #2825
v2.5.0
Compare Source
Improvements
features, as well as many overall code improvements to help reduce the React
Apollo bundle size.
#2758
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
v2.4.1
Compare Source
Improvements
Adds a
onSubscriptionComplete
prop to theSubscription
component, thatcan be passed a callback to be called when the subscription observable
is completed.
@sujeetsr in #2716
During server-side rendering,
ObservableQuery
objects created inprevious rendering passes will now be preserved in later passes (within
the same
getDataFromTree
orgetMarkupFromTree
call), so that errorscan be handled properly when using the
errorPolicy: "all"
option.PR #2753
v2.4.0
Compare Source
Bug Fixes
onCompleted
/onError
even ifMutation
unmounts.PR #2710
Improvements
walkTree
function has been deprecated, since there's no way tomake its behavior consistent with the latest versions of React. To save
bundle size,
walkTree
is no longer exported fromreact-apollo
,though you can still access it as follows:
v2.3.3
Compare Source
Bug Fixes
react-dom
as a peer dependency (since it's used bygetDataFromTree
and
renderToStringWithData
).@hwillson in #2660
Improvements
react
14.x support, since the 14.x release line is 2 years old now,and
react-apollo
is no longer tested against it.@hwillson in #2660
v2.3.2
Compare Source
Improvements
Bug Fixes
react-dom/server
unconditionally at thetop level, making
react-apollo
safer to use in environments like ReactNative that are neither browser-like nor Node-like, and thus struggle to
import
react-dom/server
and its dependencies. Additionally, the ReactNative bundler has been instructed to ignore all
react-dom/server
dependencies within
react-apollo
, soreact-dom
will not be bundledin React Native apps simply because they import
react-apollo
.PR #2627
v2.3.1
Compare Source
Improvements
Restore original
getDataFromTree(tree, context)
API, and introduce anew alternative called
getMarkupFromTree
to enable custom renderingfunctions:
PR #2586
Bug Fixes
react-apollo/...
imports. This problem was fixed in version 2.3.1 byrunning
npm publish
from thelib/
directory, as intended.Issue #2591
v2.3.0
Compare Source
Bug Fixes
networkStatus
to reflect the loading state correctly for partialrefetching.
@steelbrain in #2493
Improvements
getDataFromTree
usingReactDOM.renderToStaticMarkup
tomake asynchronous server-side rendering compatible with
React hooks.
Although the rendering function used by
getDataFromTree
defaults torenderToStaticMarkup
, any suitable rendering function can be passed asthe optional second argument to
getDataFromTree
, which now returns aPromise<string>
that resolves to The HTML rendered in the final pass,which means calling
renderToString
aftergetDataFromTree
may not benecessary anymore.
PR #2533
v2.2.4
Compare Source
Bug Fixes
lodash.isequal
was improperly set as a dev dependency forMockLink
/MockedProvider
. It is now a dependency.@danilobuerger in #2449
Improvements
Subscription
component now accepts afetchPolicy
prop.@MatthieuLemoine in #2298
Typescript
TVariables
generic is passed toObservableQuery
.@tgriesser in #2311
v2.2.3
Compare Source
Bug Fixes
a default
errorPolicy
ofall
.@amacleay in #2374
<Mutation />
refetchQueries
triggered by name (string) will now use the correct variables.@fracmal in #2422
Improvements
lodash
dependency withlodash.flowright
(since that's theonly non-dev
lodash
function we're dependent on). Devlodash
dependencies have also been updated to use their individual module
equivalent.
@hwillson in #2435
rollup-plugin-babel-minify
as it's no longer being used.@hwillson in #2436
getDataFromTree.ts
logic adjustment to avoid unnecessary callswhen a falsy
element
is encountered.@HOUCe in #2429
graphql
14 updates.@hwillson in #2437
latest version of React Apollo.
@hwillson in #2439
Typescript
lodash
typings.@williamboman in #2430
context
toMutationOptions
.@danilobuerger in #2354
MutationOptions
changes/fixes.@danilobuerger in #2340
allowSyntheticDefaultImports
use. Typescript'sallowSyntheticDefaultImports
compiler option is something we'd like tostart using, but we jumped the gun a bit by introducing it in
apollographql/react-apollo@9a96519.
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
, tobe able to handle default imports properly. This is because we're also using
Typescript's
es2015
module
option, which meansallowSyntheticDefaultImports
has to be enabled explicitly. We'veswitched back to using a combination of
import * as X
andrequire
syntax, to work with default imports. We'll re-introduce
allowSyntheticDefaultImports
use in React Apollo 3.@hwillson in #2438
v2.2.2
Compare Source
React.createContext
and SSR, we now make sure the contextprovider value is reset to the previous value it had after its children are
walked.
@mitchellhamilton in #2304
When a query failed on the first result, the query result
data
was beingreturned as
undefined
. This behavior has been changed so thatdata
isreturned as an empty object. This makes checking for data (e.g.
instead of
data && data.user
you can just checkdata.user
) anddestructring (e.g.
{ data: { user } }
) easier. Note: this couldpotentially 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
Compare Source
Partial<TData>
instead ofTData | {}
, for theQueryResult
data
property."v2.2.0
Deprecated
MutationFunc
in favor ofMutationFn
.Added missing
onCompleted
andonError
callbacks toMutationOpts
.@danilobuerger in #2322
@excitement-engineer in #1998
<Subscription />
component now allows the registration of a callbackfunction, that will be triggered each time the component receives data. The
callback
options
object param consists of the current Apollo Clientinstance in
client
, and the received subscription data insubscriptionData
.@jedwards1211 in #1966
graphql
options
object is no longer mutated, when calculatingvariables from props. This now prevents an issue where components created
with
graphql
were not having their query variables updated properly, whenprops changed.
@ksmth in #1968
data
was beingreturned as
undefined
. This behavior has been changed so thatdata
isreturned as an empty object. This makes checking for data (e.g.
instead of
data && data.user
you can just checkdata.user
) anddestructring (e.g.
{ data: { user } }
) easier. Note: this couldpotentially 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
cache
object to be passed into the test-utilsMockedProvider
.@palmfjord in #2254
MockedProvider
mocks
prop read only.@amacleay in #2284
FetchMoreOptions
andFetchMoreQueryOptions
types, andinstead import them from Apollo Client.
@skovy in #2281
graphql
HOCoptions.skip
property.@jameslaneconkling in #2208
lodash
directly.@shahyar in #2045
Query
skip
prop is set totrue
, make sure the render proploading
param is set tofalse
, since we're not actually loadinganything.
@edorivai in #1916
@hwillson in #2404
<Subscription />
,<Query />
&<Mutation />
all supportusing an Apollo Client instance configured in the
context
or viaprops.
@quentin- in #1956
Partial<TData>
instead ofTData | {}
, for theQueryResult
data
property.@tgriesser in #2313
<Query />
onCompleted
andonError
callbacks to be triggeredvia the
componentDidUpdate
lifecycle method. This ensures these callbackscan 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
lodash/flowRight
using ES import to allow for treeshaking.@Pajn in #2332
variables
passed ingraphql
HOCoptions
werenot merged with mutation
variables
.@samginn in #2216
partialRefetch
prop (false
by default).When a
Query
component is mounted, and a mutation is executedthat returns the same ID as the mounted
Query
, but has lessfields in its result, Apollo Client's
QueryManager
returns thedata 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 toexist, 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 mutationresult 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 automaticallyrefetch
the original query and update the cache.@steelbrain in #2003
v2.1.11
getDataFromTree
where queries that threw more than oneerror had error messages swallowed, and returned an invalid error object
with circular references. Multiple errors are now preserved.
@anand-sundaram-zocdoc in #2133
<Mutation />
component andgraphql
HOC to accept a newawaitRefetchQueries
prop (boolean). When set totrue
, queries specifiedin
refetchQueries
will be completed before the mutation itself iscompleted.
awaitRefetchQueries
isfalse
by default, which meansrefetchQueries
are usually completed after the mutation has resolved.Relates to Apollo Client.
PR #3169.
@hwillson in #2214
TData
along intoMutationUpdaterFn
when usingMutationOpts
, to ensure that the updater function is properly typed.@danilobuerger in #2227
@danilobuerger in #2165
v2.1.9
onCompleted
andonError
props to theQuery
component, than canbe used to register callback functions that are to be executed after a
query successfully completes, or an error occurs.
@jeshep in #1922
UNSAFE_componentWillMount
SSR support.@leops in #2152
@danilobuerger in #2151
v2.1.8
v2.1.7
ApolloProvider
children
prop type has been changed fromelement
to
node
, to allow multiple children.@quentin- in #1955
getDerivedStateFromProps
lifecycle method.@amannn in #2076
lodash
is no longer pinned to version 4.17.10.@cherewaty in #1951
apollo-client-preset
withapollo-boost
.@JamesTheHacker in #1925
@DennisKo in #1935
<Query />
example.@petetnt in #2102
v2.1.6
getDataFromTree
to properly traverse React 16.3's context APIprovider/consumer approach.
@marnusw in #1978
ApolloClient
instance can now be passed into aMutation
component via a prop named
client
. This prop will overridean
ApolloClient
instance set viacontext
, by theApolloProvider
component.
@amneacsu in #1890
ApolloClient
instance used by a Mutation is now available in thatMutation's result.
PR #1945
@cooperka in #1945
v2.1.5
apollo-client
2.3.3PR #2105
Configuration
📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).
🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.
♻ Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.
🔕 Ignore: Close this PR and you won't be reminded about this update again.
This PR was generated by Mend Renovate. View the repository job log.