Skip to content

Commit

Permalink
Changelog update
Browse files Browse the repository at this point in the history
  • Loading branch information
hwillson committed Oct 7, 2020
1 parent 6673caa commit ff12516
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,18 @@
- `HttpLink` will now automatically strip any unused `variables` before sending queries to the GraphQL server, since those queries are very likely to fail validation, according to the [All Variables Used](https://spec.graphql.org/draft/#sec-All-Variables-Used) rule in the GraphQL specification. If you depend on the preservation of unused variables, you can restore the previous behavior by passing `includeUnusedVariables: true` to the `HttpLink` constructor (which is typically passed as `options.link` to the `ApolloClient` constructor). <br/>
[@benjamn](https://github.com/benjamn) in [#7127](https://github.com/apollographql/apollo-client/pull/7127)

- Ensure `MockLink` (used by `MockedProvider`) returns all errors through the Link's `Observable`, instead of throwing some errors (like `No more mocked responses for the query ...`) leading to uncaught exceptions. All errors are now available via the `error` property of a result, and `MockLink` will no longer trigger any uncaught exceptions. <br/>
[@hwillson](https://github.com/hwillson) in [#7110](https://github.com/apollographql/apollo-client/pull/7110)
> Returning all errors through the Link's `Observable` was the default behavior in Apollo Client 2.x. We changed it for 3, but the change has been problematic for those looking to migrate from 2.x to 3. We've decided to change this back with the understanding that not many people want or are relying on `MockLink`'s throwing exception approach. If anyone is relying on this functionality, it can be re-created by leveraging `MockLink.setOnError` as follows:
```js
const mocks = // ...your mocks...
const mockLink = new MockLink(mocks);
mockLink.setOnError(error => { throw error });
// ... then call with something like
<MockedProvider link={mockLink}>
```

## Improvements

- Support inheritance of type and field policies, according to `possibleTypes`. <br/>
Expand Down

0 comments on commit ff12516

Please sign in to comment.