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
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
Wire updated example apps into Queries section
  • Loading branch information
hwillson committed Jul 14, 2020
commit d447d244be5e09a5df4e8a9c1850ed77f5411ef6
13 changes: 4 additions & 9 deletions docs/source/data/queries.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ This article assumes you're familiar with building basic GraphQL queries. If you

This article also assumes that you've already set up Apollo Client and have wrapped your React app in an `ApolloProvider` component. Read our [getting started guide](../get-started/) if you need help with either of those steps.

> To follow along with the examples below, open up our [starter project](https://codesandbox.io/s/j2ly83749w) and [sample GraphQL server](https://codesandbox.io/s/32ypr38l61) on CodeSandbox. You can view the completed version of the app [here](https://codesandbox.io/s/n3jykqpxwm).
> To follow along with the examples below, open up our [starter project](https://codesandbox.io/s/queries-example-app-start-nvp9z) and [sample GraphQL server](https://codesandbox.io/s/queries-example-app-server-71z1g) on CodeSandbox. You can view the completed version of the app [here](https://codesandbox.io/s/queries-example-app-final-nrlnl).

## Executing a query

Expand Down Expand Up @@ -210,7 +210,6 @@ Polling provides near-real-time synchronization with your server by causing a qu
function DogPhoto({ breed }) {
const { loading, error, data } = useQuery(GET_DOG_PHOTO, {
variables: { breed },
skip: !breed,
pollInterval: 500,
});

Expand All @@ -231,7 +230,6 @@ const DogPhoto = ({ breed }) => (
<Query
query={GET_DOG_PHOTO}
variables={{ breed }}
skip={!breed}
pollInterval={500}
>
{({ loading, error, data }) => {
Expand Down Expand Up @@ -271,8 +269,7 @@ the query uses the same variables that it used in its previous execution.
```jsx:title=index.js
function DogPhoto({ breed }) {
const { loading, error, data, refetch } = useQuery(GET_DOG_PHOTO, {
variables: { breed },
skip: !breed,
variables: { breed }
});

if (loading) return null;
Expand All @@ -292,7 +289,7 @@ function DogPhoto({ breed }) {

```jsx:title=index.js
const DogPhoto = ({ breed }) => (
<Query query={GET_DOG_PHOTO} variables={{ breed }} skip={!breed}>
<Query query={GET_DOG_PHOTO} variables={{ breed }}>
{({ loading, error, data, refetch }) => {
if (loading) return null;
if (error) return `Error! ${error}`;
Expand Down Expand Up @@ -336,7 +333,6 @@ function DogPhoto({ breed }) {
GET_DOG_PHOTO,
{
variables: { breed },
skip: !breed,
notifyOnNetworkStatusChange: true,
},
);
Expand Down Expand Up @@ -364,7 +360,6 @@ const DogPhoto = ({ breed }) => (
<Query
query={GET_DOG_PHOTO}
variables={{ breed }}
skip={!breed}
notifyOnNetworkStatusChange
>
{({ loading, error, data, refetch, networkStatus }) => {
Expand Down Expand Up @@ -430,7 +425,7 @@ function DelayedQuery() {
}
```

> To view a complete version of the app we just built, check out the CodeSandbox [here](https://codesandbox.io/s/n3jykqpxwm).
> To view a complete version of the app we just built, check out the CodeSandbox [here](https://codesandbox.io/s/queries-example-app-final-nrlnl).

## useQuery API

Expand Down