Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remaining AC3 documentation updates #6429

Merged
merged 53 commits into from
Jul 14, 2020
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
53 commits
Select commit Hold shift + click to select a range
1bc7aff
Adjust explore section to align with top level docs sections
hwillson Mar 2, 2020
9593336
Remove Pupstagram references
hwillson Mar 2, 2020
e03ed55
Update `new ApolloClient` examples to include a cache
hwillson Jul 13, 2020
c18ad5f
Replace intro `cacheRedirects` example with `TypePolicies`
hwillson Mar 2, 2020
4f75961
Updates to use the AC3 ready Coinbase example
hwillson Mar 3, 2020
d447d24
Wire updated example apps into Queries section
hwillson Mar 3, 2020
8130403
Adjust the intro mutations section to use cache.modify
hwillson Mar 4, 2020
29da64d
Prepare local state section for cache policies + reactive vars
hwillson Jun 10, 2020
264b4cc
Add local resolver deprecation warning to local resolvers section
hwillson Jun 11, 2020
220fdf6
Add reactive variables section
hwillson Jun 11, 2020
dbe5b5f
Initial querying local state content
hwillson Jun 11, 2020
6f0b340
Initialize the cache + local data query flow with field policies
hwillson Jun 11, 2020
bd81162
Add "Handling @client fields with field policies" section
hwillson Jun 15, 2020
97c600a
Add "Integrating `@client` into remote queries" section
hwillson Jun 16, 2020
4233175
Update `cache.evict()` examples to use `EvictOptions`
hwillson Jun 16, 2020
43e84de
Remove broken Meteor integration docs
hwillson Jun 16, 2020
b79a533
Update to the latest docs theme
hwillson Jun 17, 2020
43f02f5
Fix broken links
hwillson Jun 16, 2020
084be4e
Remove Apollo Component code samples
hwillson Jun 17, 2020
767ff4d
Remove no longer valid local state fragment link
hwillson Jun 17, 2020
7956b77
Add dangling references section
hwillson Jun 18, 2020
fc6b63a
Explain `cache.identify`
hwillson Jun 18, 2020
777ba26
Add modifying fields (cache.modify) section
hwillson Jun 19, 2020
4979f99
Updated "Handling `@client` fields with the cache" section
hwillson Jun 19, 2020
3b50bbf
Update "Using `@client` fields as variables" section
hwillson Jun 19, 2020
d7f5b26
New "Using reactive variables to track `@client` state" section
hwillson Jun 20, 2020
0471737
Re-arrange the local state section
hwillson Jun 23, 2020
eca608a
Fully replace `cacheRedirects` examples with field policies
hwillson Jun 25, 2020
22bd499
Remove broken query splitting section
hwillson Jun 25, 2020
9f5e066
Update to latest docs theme
hwillson Jun 30, 2020
d9a2955
New `InMemoryCache` API section
hwillson Jun 26, 2020
8bdf676
Edits to local state overview
Jun 30, 2020
fb90369
Incorporate review from hwillson
Jun 30, 2020
cdd7c89
Update to the latest docs theme
hwillson Jun 17, 2020
fee5638
Update to latest docs theme
hwillson Jun 25, 2020
20227d6
WIP on Managing state with field policies
Jul 1, 2020
905f1a3
More WIP on managing state with field policies
Jul 2, 2020
7ba4f68
Get local-only fields article ready for review
Jul 2, 2020
8cca447
Refactor some content
Jul 7, 2020
523cf24
In-progress edits to core caching articles
Jul 7, 2020
a6cead7
Clarify use of cache.identify
Jul 7, 2020
182f60d
Clarify local-only field content
Jul 7, 2020
7fbe7a1
Fold querying and updating into local-only fields article
Jul 8, 2020
1b4451f
Fix broken links
Jul 8, 2020
2524fa4
Updates to reactive variables article
Jul 9, 2020
fefe916
Fix a word
Jul 9, 2020
ba40a80
Miscellaneous IA and formatting cleanup
Jul 10, 2020
bdc71e1
Edits to AC intro and getting started
Jul 11, 2020
bf9d073
Add missing dependency for ink
Jul 11, 2020
3079d15
Fix broken links
Jul 13, 2020
97457cc
update link checking exceptions and add redirect
Jul 13, 2020
64c725b
Add some missing dependencies
Jul 13, 2020
69f2951
Add a redirect for 3.0 beta docs to root
trevorblades Jul 14, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Fix broken links
  • Loading branch information
Stephen Barlow authored and hwillson committed Jul 14, 2020
commit 3079d15d7f8bbb311192e3c806cf7318ff4cd64b
4 changes: 2 additions & 2 deletions docs/source/api/react/hoc.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ const TodoAppWithData = withTodoAppQuery(TodoApp);
export default TodoAppWithData;
```

The `graphql()` function will only be able to provide access to your GraphQL data if there is a [`<ApolloProvider/>`](./hooks/#apolloprovider) component higher up in your tree to provide an [`ApolloClient`](../core/) instance that will be used to fetch your data.
The `graphql()` function will only be able to provide access to your GraphQL data if there is a [`<ApolloProvider/>`](./hooks/#apolloprovider) component higher up in your tree to provide an [`ApolloClient`](../core/ApolloClient/) instance that will be used to fetch your data.

The behavior of your component enhanced with the `graphql()` function will be different depending on if your GraphQL operation is a [query](../../data/queries/), a [mutation](../../data/mutations/), or a [subscription](../../data/subscriptions/). Go to the appropriate API documentation for more information about the functionality and available options for each type.

Expand Down Expand Up @@ -1071,7 +1071,7 @@ export default graphql(
import { withApollo } from '@apollo/react-hoc';
```

A simple enhancer which provides direct access to your [`ApolloClient`](../core/) instance. This is useful if you want to do custom logic with Apollo. Such as calling one-off queries. By calling this function with the component you want to enhance, `withApollo()` will create a new component which passes in an instance of `ApolloClient` as a `client` prop.
A simple enhancer which provides direct access to your [`ApolloClient`](../core/ApolloClient/) instance. This is useful if you want to do custom logic with Apollo. Such as calling one-off queries. By calling this function with the component you want to enhance, `withApollo()` will create a new component which passes in an instance of `ApolloClient` as a `client` prop.

If you are wondering when to use `withApollo()` and when to use [`graphql()`](#graphqlquery-configcomponent) the answer is that most of the time you will want to use `graphql()`. `graphql()` provides many of the advanced features you need to work with your GraphQL data. You should only use `withApollo()` if you want the GraphQL client without any of the other features.

Expand Down
262 changes: 0 additions & 262 deletions docs/source/features/caching.md

This file was deleted.

4 changes: 2 additions & 2 deletions docs/source/local-state/local-resolvers.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ cache.writeQuery({
});
```

Sometimes you may need to [reset the store](../api/core/#ApolloClient.resetStore) in your application, when a user logs out for example. If you call `client.resetStore` anywhere in your application, you will likely want to initialize your cache again. You can do this using the `client.onResetStore` method to register a callback that will call `cache.writeQuery` again.
Sometimes you may need to [reset the store](../api/core/ApolloClient/#ApolloClient.resetStore) in your application, when a user logs out for example. If you call `client.resetStore` anywhere in your application, you will likely want to initialize your cache again. You can do this using the `client.onResetStore` method to register a callback that will call `cache.writeQuery` again.

```js
import { ApolloClient, InMemoryCache } from '@apollo/client';
Expand Down Expand Up @@ -562,7 +562,7 @@ Pulling `@client` field values directly out of the cache isn't quite as flexible

### Working with fetch policies

Before Apollo Client executes a query, one of the first things it does is check to see which [`fetchPolicy`](../api/core/#apolloclient-functions) it has been configured to use. It does this so it knows where it should attempt to resolve the query from first, either the cache or the network. When running a query, Apollo Client treats `@client` based local resolvers just like it does remote resolvers, in that it will adhere to its defined `fetchPolicy` to know where to attempt to pull data from first. When working with local resolvers, it's important to understand how fetch policies impact the running of resolver functions, since by default local resolver functions are not run on every request. This is because the result of running a local resolver is cached with the rest of the query result, and pulled from the cache on the next request. Let's look at an example:
Before Apollo Client executes a query, one of the first things it does is check to see which [`fetchPolicy`](../api/core/ApolloClient/#apolloclient-functions) it has been configured to use. It does this so it knows where it should attempt to resolve the query from first, either the cache or the network. When running a query, Apollo Client treats `@client` based local resolvers just like it does remote resolvers, in that it will adhere to its defined `fetchPolicy` to know where to attempt to pull data from first. When working with local resolvers, it's important to understand how fetch policies impact the running of resolver functions, since by default local resolver functions are not run on every request. This is because the result of running a local resolver is cached with the rest of the query result, and pulled from the cache on the next request. Let's look at an example:

```jsx
import React, { Fragment } from "react";
Expand Down