Skip to content

Commit c84123d

Browse files
author
Sashko Stubailo
authored
Merge branch 'master' into patch-2
2 parents a35ccc9 + 4244f4f commit c84123d

File tree

20 files changed

+101
-97
lines changed

20 files changed

+101
-97
lines changed

.circleci/config.yml

+20-20
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,12 @@ jobs:
66
steps:
77
- checkout
88
- restore_cache:
9-
key: dependency-cache-{{ checksum "package.json" }}
9+
key: v1-dependency-cache-{{ checksum "package.json" }}
1010
- run:
1111
name: install-npm
1212
command: npm install
1313
- save_cache:
14-
key: dependency-cache-{{ checksum "package.json" }}
14+
key: v1-dependency-cache-{{ checksum "package.json" }}
1515
paths:
1616
- ./node_modules
1717
- run: npm run danger
@@ -21,12 +21,12 @@ jobs:
2121
steps:
2222
- checkout
2323
- restore_cache:
24-
key: dependency-cache-{{ checksum "package.json" }}
24+
key: v1-dependency-cache-{{ checksum "package.json" }}
2525
- run:
2626
name: install-npm
2727
command: npm install
2828
- save_cache:
29-
key: dependency-cache-{{ checksum "package.json" }}
29+
key: v1-dependency-cache-{{ checksum "package.json" }}
3030
paths:
3131
- ./node_modules
3232
- run: cd docs && npm i && npm run build
@@ -36,12 +36,12 @@ jobs:
3636
steps:
3737
- checkout
3838
- restore_cache:
39-
key: dependency-cache-{{ checksum "package.json" }}
39+
key: v1-dependency-cache-{{ checksum "package.json" }}
4040
- run:
4141
name: install-npm
4242
command: npm install
4343
- save_cache:
44-
key: dependency-cache-{{ checksum "package.json" }}
44+
key: v1-dependency-cache-{{ checksum "package.json" }}
4545
paths:
4646
- ./node_modules
4747
- run: npm run filesize
@@ -51,12 +51,12 @@ jobs:
5151
steps:
5252
- checkout
5353
- restore_cache:
54-
key: dependency-cache-{{ checksum "package.json" }}
54+
key: v1-dependency-cache-{{ checksum "package.json" }}
5555
- run:
5656
name: install-npm
5757
command: npm install
5858
- save_cache:
59-
key: dependency-cache-{{ checksum "package.json" }}
59+
key: v1-dependency-cache-{{ checksum "package.json" }}
6060
paths:
6161
- ./node_modules
6262
- run: npm run type-check
@@ -66,12 +66,12 @@ jobs:
6666
steps:
6767
- checkout
6868
- restore_cache:
69-
key: dependency-cache-{{ checksum "package.json" }}
69+
key: v1-dependency-cache-{{ checksum "package.json" }}
7070
- run:
7171
name: install-npm
7272
command: npm install
7373
- save_cache:
74-
key: dependency-cache-{{ checksum "package.json" }}
74+
key: v1-dependency-cache-{{ checksum "package.json" }}
7575
paths:
7676
- ./node_modules
7777
- run:
@@ -89,12 +89,12 @@ jobs:
8989
steps:
9090
- checkout
9191
- restore_cache:
92-
key: dependency-cache-{{ checksum "package.json" }}
92+
key: v1-dependency-cache-{{ checksum "package.json" }}
9393
- run:
9494
name: install-npm
9595
command: npm install
9696
- save_cache:
97-
key: dependency-cache-{{ checksum "package.json" }}
97+
key: v1-dependency-cache-{{ checksum "package.json" }}
9898
paths:
9999
- ./node_modules
100100
- run:
@@ -112,12 +112,12 @@ jobs:
112112
steps:
113113
- checkout
114114
- restore_cache:
115-
key: dependency-cache-{{ checksum "package.json" }}
115+
key: v1-dependency-cache-{{ checksum "package.json" }}
116116
- run:
117117
name: install-npm
118118
command: npm install
119119
- save_cache:
120-
key: dependency-cache-{{ checksum "package.json" }}
120+
key: v1-dependency-cache-{{ checksum "package.json" }}
121121
paths:
122122
- ./node_modules
123123
- run:
@@ -135,12 +135,12 @@ jobs:
135135
steps:
136136
- checkout
137137
- restore_cache:
138-
key: dependency-cache-{{ checksum "package.json" }}
138+
key: v1-dependency-cache-{{ checksum "package.json" }}
139139
- run:
140140
name: install-npm
141141
command: npm install
142142
- save_cache:
143-
key: dependency-cache-{{ checksum "package.json" }}
143+
key: v1-dependency-cache-{{ checksum "package.json" }}
144144
paths:
145145
- ./node_modules
146146
- run:
@@ -158,12 +158,12 @@ jobs:
158158
steps:
159159
- checkout
160160
- restore_cache:
161-
key: dependency-cache-{{ checksum "package.json" }}
161+
key: v1-dependency-cache-{{ checksum "package.json" }}
162162
- run:
163163
name: install-npm
164164
command: npm install
165165
- save_cache:
166-
key: dependency-cache-{{ checksum "package.json" }}
166+
key: v1-dependency-cache-{{ checksum "package.json" }}
167167
paths:
168168
- ./node_modules
169169
- run:
@@ -181,12 +181,12 @@ jobs:
181181
steps:
182182
- checkout
183183
- restore_cache:
184-
key: dependency-cache-{{ checksum "package.json" }}
184+
key: v1-dependency-cache-{{ checksum "package.json" }}
185185
- run:
186186
name: install-npm
187187
command: npm install
188188
- save_cache:
189-
key: dependency-cache-{{ checksum "package.json" }}
189+
key: v1-dependency-cache-{{ checksum "package.json" }}
190190
paths:
191191
- ./node_modules
192192
- run:

docs/source/advanced/boost-migration.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ import { InMemoryCache } from 'apollo-cache-inmemory';
132132
import { HttpLink } from 'apollo-link-http';
133133
import { onError } from 'apollo-link-error';
134134
import { withClientState } from 'apollo-link-state';
135-
import { ApolloLink } from 'apollo-link';
135+
import { ApolloLink, Observable } from 'apollo-link';
136136

137137
const cache = new InMemoryCache({
138138
cacheRedirects: {
@@ -154,7 +154,7 @@ const request = async (operation) => {
154154

155155
const requestLink = new ApolloLink((operation, forward) =>
156156
new Observable(observer => {
157-
let handle: any;
157+
let handle;
158158
Promise.resolve(operation)
159159
.then(oper => request(oper))
160160
.then(() => {
@@ -167,7 +167,7 @@ const requestLink = new ApolloLink((operation, forward) =>
167167
.catch(observer.error.bind(observer));
168168

169169
return () => {
170-
if (handle) handle.unsubscribe;
170+
if (handle) handle.unsubscribe();
171171
};
172172
})
173173
);

docs/source/advanced/caching.md

+2
Original file line numberDiff line numberDiff line change
@@ -303,6 +303,8 @@ mutate({
303303
Using `update` gives you full control over the cache, allowing you to make changes to your data model in response to a mutation in any way you like. `update` is the recommended way of updating the cache after a query. It is explained in full [here](../api/react-apollo.html#graphql-mutation-options-update).
304304

305305
```javascript
306+
import CommentAppQuery from '../queries/CommentAppQuery';
307+
306308
const SUBMIT_COMMENT_MUTATION = gql`
307309
mutation submitComment($repoFullName: String!, $commentContent: String!) {
308310
submitComment(

docs/source/api/react-apollo.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -890,7 +890,7 @@ The higher order component created when you pass a mutation to `graphql()` will
890890

891891
The `mutate` function will actually execute your mutation using the network interface therefore mutating your data. The `mutate` function will also then update your cache in ways you define.
892892

893-
To learn more about how mutations work, be sure to check out the [mutations usage documentation](mutations.html).
893+
To learn more about how mutations work, be sure to check out the [mutations usage documentation](../essentials/mutations.html).
894894

895895
The `mutate` function accepts the same options that [`config.options` for mutations](#graphql-mutation-options) accepts, so make sure to read through the documentation for that to know what you can pass into the `mutate` function.
896896

docs/source/essentials/mutations.md

+2
Original file line numberDiff line numberDiff line change
@@ -266,6 +266,8 @@ The render prop function that you pass to the `children` prop of `Mutation` is c
266266
<dd>Any errors returned from the mutation</dd>
267267
<dt>`called`: boolean</dt>
268268
<dd>A boolean indicating if the mutate function has been called</dd>
269+
<dt>`client`: ApolloClient</dt>
270+
<dd>Your `ApolloClient` instance. Useful for invoking cache methods outside the context of the update function, such as `client.writeData` and `client.readQuery`.</dd>
269271
</dl>
270272
271273
<h2 id="next-steps">Next steps</h2>

docs/source/react-apollo-migration.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ For more information on how to use the new Query component, read the [full guide
168168
Much like the Query component, the Mutation and Subscription component are ways to use Apollo directly within your react tree. They simplify integrating with Apollo, and keep your React app written in React! For more information on the Mutation component, [check out the usage guide](./essentials/mutations.html) or if you are wanting to learn about the Subscription component, [read how to here](./advanced/subscriptions.html).
169169

170170
<h2 id="context">ApolloConsumer</h2>
171-
With upcoming versions of React (starting in React 16.3), there is a new version of context that makes it easier than ever to use components connected to state higher in the tree. While the 2.1 doesn't require React 16.3, we are making easier than ever to start writing in this style with the `<ApolloConsumer>` component. This is just like the `withApollo` higher order component, just in a normal React component! It takes no props and expects a child function which recieves the instance of Apollo Client in your tree. For example:
171+
With upcoming versions of React (starting in React 16.3), there is a new version of context that makes it easier than ever to use components connected to state higher in the tree. While the 2.1 doesn't require React 16.3, we are making it easier than ever to start writing in this style with the `<ApolloConsumer>` component. This is just like the `withApollo` higher order component, just in a normal React component! It takes no props and expects a child function which receives the instance of Apollo Client in your tree. For example:
172172

173173
```js
174174
const MyClient = () => (

docs/source/recipes/authentication.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ app.use(cors(corsOptions));
3535
```
3636
## Header
3737

38-
Another common way to identify yourself when using HTTP is to send along an authorization header. Apollo Links allow to create middlewares that let you modify requests before they are sent to the server. It's easy to add an `authorization` header to every HTTP request. In this example, we'll pull the login token from `localStorage` every time a request is sent:
38+
Another common way to identify yourself when using HTTP is to send along an authorization header. It's easy to add an `authorization` header to every HTTP request by chaining together Apollo Links. In this example, we'll pull the login token from `localStorage` every time a request is sent:
3939

4040
```js
4141
import { ApolloClient } from 'apollo-client';

docs/source/why-apollo.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ title: Why Apollo Client?
33
description: Why choose Apollo Client to manage your data?
44
---
55

6-
Data management shouldn't have to be so difficult! If you're wondering how to simplify managing remote and local data in your React application, then you've came to the right place. Through practical examples inspired by our [example app Pupstagram](https://codesandbox.io/s/r5qp83z0yq), you'll learn how Apollo's intelligent caching and declarative approach to data fetching can help you iterate faster while writing less code. Let's jump right in! 🚀
6+
Data management shouldn't have to be so difficult! If you're wondering how to simplify managing remote and local data in your React application, then you've come to the right place. Through practical examples inspired by our [example app Pupstagram](https://codesandbox.io/s/r5qp83z0yq), you'll learn how Apollo's intelligent caching and declarative approach to data fetching can help you iterate faster while writing less code. Let's jump right in! 🚀
77

88
<h2 id="declarative-data">Declarative data fetching</h2>
99

@@ -22,7 +22,7 @@ const Feed = () => (
2222
)
2323
```
2424

25-
Here we're using a Query component to fetch some dogs from our GraphQL server and display them in a list. The Query component uses the render prop API (with a function as a child) to bind a query to our component and render it based on the results of our query. Once our data comes back, our `<DogList />` component will update reactively with the data it needs.
25+
Here we're using a Query component to fetch some dogs from our GraphQL server and display them in a list. The Query component uses the React [render prop API](https://reactjs.org/docs/render-props.html) (with a function as a child) to bind a query to our component and render it based on the results of our query. Once our data comes back, our `<DogList />` component will update reactively with the data it needs.
2626

2727
Apollo Client takes care of the request cycle from start to finish, including tracking loading and error states for you. There's no middleware to set up or boilerplate to write before making your first request, nor do you need to worry about transforming and caching the response. All you have to do is describe the data your component needs and let Apollo Client do the heavy lifting. 💪
2828

package.json

+4-4
Original file line numberDiff line numberDiff line change
@@ -74,13 +74,13 @@
7474
"devDependencies": {
7575
"bundlesize": "0.17.0",
7676
"check-if-folder-contents-changed-in-git-commit-range": "1.0.0",
77-
"codecov": "3.0.0",
77+
"codecov": "3.0.1",
7878
"danger": "1.2.0",
79-
"jest-junit": "3.6.0",
80-
"lerna": "2.10.1",
79+
"jest-junit": "3.7.0",
80+
"lerna": "2.11.0",
8181
"lint-staged": "6.1.0",
8282
"pre-commit": "1.2.2",
83-
"prettier": "1.11.1",
83+
"prettier": "1.12.1",
8484
"rollup-plugin-local-resolve": "1.0.7",
8585
"rollup-plugin-node-resolve": "3.3.0",
8686
"rollup-plugin-sourcemaps": "0.4.2",

packages/apollo-boost/package.json

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "apollo-boost",
3-
"version": "0.1.4",
3+
"version": "0.1.5",
44
"description": "The easiest way to get started with Apollo Client",
55
"author": "Peggy Rayzis <peggy@apollographql.com>",
66
"contributors": [
@@ -33,8 +33,8 @@
3333
"filesize": "npm run build && npm run build:browser"
3434
},
3535
"dependencies": {
36-
"apollo-cache-inmemory": "^1.1.12",
37-
"apollo-client": "^2.2.8",
36+
"apollo-cache-inmemory": "^1.2.0",
37+
"apollo-client": "^2.3.0",
3838
"apollo-link": "^1.0.6",
3939
"apollo-link-error": "^1.0.3",
4040
"apollo-link-http": "^1.3.1",
@@ -44,11 +44,11 @@
4444
"devDependencies": {
4545
"@types/graphql": "0.12.7",
4646
"@types/jest": "21.1.10",
47-
"apollo-cache": "^1.1.7",
47+
"apollo-cache": "^1.1.8",
4848
"browserify": "15.2.0",
4949
"graphql": "0.13.2",
5050
"jest": "20.0.4",
51-
"lodash": "4.17.5",
51+
"lodash": "4.17.10",
5252
"rimraf": "2.6.2",
5353
"ts-jest": "20.0.14",
5454
"tslint": "5.9.1",

packages/apollo-cache-inmemory/CHANGELOG.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Change log
22

3-
### vNext
3+
### 1.2.0
44
- Various optimizations for cache read performance [#3300](https://github.com/apollographql/apollo-client/pull/3300)
55
- Fix typo in documentation
66

packages/apollo-cache-inmemory/package.json

+8-8
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "apollo-cache-inmemory",
3-
"version": "1.1.12",
3+
"version": "1.2.0",
44
"description": "Core abstract of Caching layer for Apollo Client",
55
"author": "James Baxley <james@meteor.com>",
66
"contributors": [
@@ -39,24 +39,24 @@
3939
"filesize": "npm run build:browser"
4040
},
4141
"dependencies": {
42-
"apollo-cache": "^1.1.7",
43-
"apollo-utilities": "^1.0.11",
44-
"graphql-anywhere": "^4.1.8"
42+
"apollo-cache": "^1.1.8",
43+
"apollo-utilities": "^1.0.12",
44+
"graphql-anywhere": "^4.1.9"
4545
},
4646
"peerDependencies": {
4747
"graphql": "0.11.7 || ^0.12.0 || ^0.13.0"
4848
},
4949
"devDependencies": {
5050
"@types/graphql": "0.12.7",
5151
"@types/jest": "21.1.10",
52-
"@types/lodash": "4.14.105",
52+
"@types/lodash": "4.14.108",
5353
"browserify": "15.2.0",
5454
"graphql": "0.13.2",
55-
"graphql-tag": "2.8.0",
55+
"graphql-tag": "2.9.2",
5656
"jest": "20.0.4",
57-
"lodash": "4.17.5",
57+
"lodash": "4.17.10",
5858
"rimraf": "2.6.2",
59-
"rollup": "0.56.4",
59+
"rollup": "0.58.2",
6060
"ts-jest": "20.0.14",
6161
"tslint": "5.9.1",
6262
"typescript": "2.5.2",

packages/apollo-cache/package.json

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "apollo-cache",
3-
"version": "1.1.7",
3+
"version": "1.1.8",
44
"description": "Core abstract of Caching layer for Apollo Client",
55
"author": "James Baxley <james@meteor.com>",
66
"contributors": [
@@ -38,17 +38,17 @@
3838
"filesize": "npm run build && npm run build:browser"
3939
},
4040
"dependencies": {
41-
"apollo-utilities": "^1.0.11"
41+
"apollo-utilities": "^1.0.12"
4242
},
4343
"devDependencies": {
4444
"@types/graphql": "0.12.7",
4545
"@types/jest": "21.1.10",
4646
"browserify": "15.2.0",
4747
"graphql": "0.13.2",
48-
"graphql-tag": "2.8.0",
48+
"graphql-tag": "2.9.2",
4949
"jest": "20.0.4",
5050
"rimraf": "2.6.2",
51-
"rollup": "0.56.4",
51+
"rollup": "0.58.2",
5252
"rollup-plugin-node-resolve": "3.3.0",
5353
"ts-jest": "20.0.14",
5454
"tslint": "5.9.1",

packages/apollo-client/CHANGELOG.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11

22
# Change log
33

4-
### vNEXT
4+
### 2.3.0
55
- fixed edge case bug of changing fetchPolicies right after resetStore with no variables present
66
- Various optimizations for cache read performance [#3300](https://github.com/apollographql/apollo-client/pull/3300)
77

0 commit comments

Comments
 (0)