You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: docs/source/advanced/caching.md
+2
Original file line number
Diff line number
Diff line change
@@ -303,6 +303,8 @@ mutate({
303
303
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).
Copy file name to clipboardexpand all lines: docs/source/api/react-apollo.md
+1-1
Original file line number
Diff line number
Diff line change
@@ -890,7 +890,7 @@ The higher order component created when you pass a mutation to `graphql()` will
890
890
891
891
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.
892
892
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).
894
894
895
895
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.
Copy file name to clipboardexpand all lines: docs/source/essentials/mutations.md
+2
Original file line number
Diff line number
Diff line change
@@ -266,6 +266,8 @@ The render prop function that you pass to the `children` prop of `Mutation` is c
266
266
<dd>Any errors returned from the mutation</dd>
267
267
<dt>`called`: boolean</dt>
268
268
<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>
Copy file name to clipboardexpand all lines: docs/source/react-apollo-migration.md
+1-1
Original file line number
Diff line number
Diff line change
@@ -168,7 +168,7 @@ For more information on how to use the new Query component, read the [full guide
168
168
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).
169
169
170
170
<h2id="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:
Copy file name to clipboardexpand all lines: docs/source/recipes/authentication.md
+1-1
Original file line number
Diff line number
Diff line change
@@ -35,7 +35,7 @@ app.use(cors(corsOptions));
35
35
```
36
36
## Header
37
37
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:
Copy file name to clipboardexpand all lines: docs/source/why-apollo.md
+2-2
Original file line number
Diff line number
Diff line change
@@ -3,7 +3,7 @@ title: Why Apollo Client?
3
3
description: Why choose Apollo Client to manage your data?
4
4
---
5
5
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! 🚀
7
7
8
8
<h2id="declarative-data">Declarative data fetching</h2>
9
9
@@ -22,7 +22,7 @@ const Feed = () => (
22
22
)
23
23
```
24
24
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.
26
26
27
27
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. 💪
0 commit comments