Skip to content

Commit a58b1bc

Browse files
authored
Merge pull request #3845 from EledenGreen/patch-13
8c-e: updated links, sentence
2 parents affc55b + 8a7486c commit a58b1bc

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/content/8/en/part8d.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ Use of the effect hook is necessary to avoid an endless rendering loop.
114114

115115
Let's also add a button which enables a logged-in user to log out. The button's onClick handler sets the *token* state to null, removes the token from local storage and resets the cache of the Apollo client. The last step is [important](https://www.apollographql.com/docs/react/networking/authentication/#reset-store-on-logout), because some queries might have fetched data to cache, which only logged-in users should have access to.
116116

117-
We can reset the cache using the [resetStore](https://www.apollographql.com/docs/react/api/core/ApolloClient/#ApolloClient.resetStore) method of an Apollo *client* object.
117+
We can reset the cache using the [resetStore](https://www.apollographql.com/docs/react/api/core/ApolloClient#resetstore) method of an Apollo *client* object.
118118
The client can be accessed with the [useApolloClient](https://www.apollographql.com/docs/react/api/react/hooks#useapolloclient) hook:
119119

120120
```js
@@ -272,7 +272,7 @@ query ALLPERSONS in the cache by adding the new person to the cached data.
272272
273273
In some situations, the only sensible way to keep the cache up to date is using the *update* callback.
274274
275-
When necessary, it is possible to disable cache for the whole application or [single queries](https://www.apollographql.com/docs/react/api/react/hooks/#options) by setting the field managing the use of cache, [fetchPolicy](https://www.apollographql.com/docs/react/data/queries/#configuring-fetch-logic) as <em>no-cache</em>.
275+
When necessary, it is possible to disable cache for the whole application or [single queries](https://www.apollographql.com/docs/react/api/react/hooks/#options) by setting the field managing the use of cache, [fetchPolicy](https://www.apollographql.com/docs/react/data/queries#setting-a-fetch-policy) as <em>no-cache</em>.
276276
277277
Be diligent with the cache. Old data in the cache can cause hard-to-find bugs. As we know, keeping the cache up to date is very challenging. According to a coder proverb:
278278

src/content/8/en/part8e.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -637,7 +637,7 @@ If the subscription does not work, check that you have the correct connection se
637637

638638
The backend code can be found on [GitHub](https://github.com/fullstack-hy2020/graphql-phonebook-backend/tree/part8-7), branch <i>part8-7</i>.
639639

640-
Implementing subscriptions involves a lot of configurations. You will be able to cope with the few exercises of this course without worrying much about the details. If you are planning to use subscriptions in an production use application, you should definitely read Apollo's [documentation on subscriptions](https://www.apollographql.com/docs/apollo-server/data/subscriptions) carefully.
640+
Implementing subscriptions involves a lot of configurations. You will be able to cope with the few exercises of this course without worrying much about the details. If you are planning to use subscriptions in a production application, you should definitely read Apollo's [documentation on subscriptions](https://www.apollographql.com/docs/apollo-server/data/subscriptions) carefully.
641641

642642
### Subscriptions on the client
643643

0 commit comments

Comments
 (0)