Skip to content
This repository has been archived by the owner on Apr 13, 2023. It is now read-only.

Releases: apollographql/react-apollo

2.5.8

02 Jul 11:22
Compare
Choose a tag to compare

2.5.8 (2019-06-21)

Bug Fixes

  • Makes the use of apollo-client 2.6.3's ObservableQuery.resetQueryStoreErrors
    method optional, for people who can't update to react-apollo's new
    apollo-client peer dep of 2.6.3.
    @hwillson in #3151

2.5.7

21 Jun 18:00
Compare
Choose a tag to compare

2.5.7 (2019-06-21)

Improvements

  • Make sure MockedProvider is using the proper CJS/ESM bundle, when
    referencing ApolloProvider.
    @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 the graphql HOC.
    @andycarrell in #3008
  • Check equality of stringified variables in the MockLink to improve
    debugging experience used by MockedProvider.
    @evans in #3078

Bug Fixes

  • Removed leftover apollo-client@beta peer dep.
    @brentertz in #3064
  • Stop setting optional input to null, when using the graphql HOC.
    @ZhengYuTay in #3056
  • Fix typescript error caused by query being mandatory in the fetchMore
    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). The Query 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 for network-only fetch policy.
    @jasonpaulos in #3126

2.5.5

22 Apr 09:53
Compare
Choose a tag to compare

Improvements

  • Export the Apollo Context provider (ApolloContext).
    @MrLoh in #2961

2.5.4

05 Apr 19:04
Compare
Choose a tag to compare

Bug Fixes

  • Fixes Could not find "client" in the context of ApolloConsumer errors when
    using MockedProvider.
    @hwillson in #2907
  • Ensure Query components using a fetchPolicy of no-cache have their
    data preserved when the components tree is re-rendered.
    @hwillson in #2914

Improvements

2.5.3

25 Mar 01:01
Compare
Choose a tag to compare

2.5.3

Bug Fixes

  • Fixed an infinite loop caused by using setState in the
    onError / onCompleted callbacks of the Query 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 internal lastResult value (that's used
    to help prevent unnecessary re-renders) not being updated.
    @Glennrs in #2840

Improvements

  • MockedProvider now accepts a childProps 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 from MockedResponse's,
    when using MockedProvider.
    @ajmath in #2523

  • MockedProvider has been updated to stop setting a default resolvers
    value of {}, which means by default Apollo Client 2.5 local resolver
    functionality is not enabled when mocking with MockedProvider. 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 the MockedProvider resolvers prop.
    @ajmath in #2524

  • Improvements to the graphql HOC generics for fetchMore and refetch.
    @EricMcRay in #2525

  • The ApolloProvider / ApolloConsumer implementations have been refactored
    to use React 16.3's new context API.
    @wzrdzl in #2540

  • All dependencies and devDependencies have been updated to their latest
    versions, and related Typescript changes have been applied.
    @hwillson in #2873

2.5.1

28 Feb 01:36
Compare
Choose a tag to compare

2.5.1

Bug Fixes

  • Make sure 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

2.5.0

28 Feb 01:35
2a330a7
Compare
Choose a tag to compare

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 using MockedProvider, 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

24 Jan 19:02
229925b
Compare
Choose a tag to compare

2.4.0

Bug Fixes

  • Invoke onCompleted/onError even if Mutation 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 of MockedProvider 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
    apollo-client@2.4.x versions, we decided to bump the minor version of
    react-apollo (to 2.4.0) because of this new apollo-client version
    requirement.

2.2.4

02 Oct 10:52
Compare
Choose a tag to compare

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

Typescript

  • Make sure the TVariables generic is passed to ObservableQuery.
    @tgriesser in #2311

2.2.3

30 Sep 10:17
Compare
Choose a tag to compare

2.2.3 (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
    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, 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