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: tutorial/simple-todos-graphql/03-first-query.md
+5-5Lines changed: 5 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -100,9 +100,9 @@ export const App = () => {
100
100
..
101
101
```
102
102
103
-
Notice that in the query `tasksQuery` we just need the `_id` and the `text` as the `isChecked` is coming from the subscription, and we used the `createdAt` to sort the tasks in the server side, so we don't need it in the client side.
103
+
Notice that in the query `tasksQuery` we just need the `_id` and the `text` as the `isChecked` is coming from the subscription, and we used the `createdAt` to sort the tasks on the server side, so we don't need it in the client side.
104
104
105
-
Now our tasks, fetched with GraphQL, have their status again, and the tasks' status were fetched with a subscription. When you do the changes and refresh your app again, all the tasks' text should now be visible.
105
+
Now our tasks, fetched with GraphQL, have their status again, and the tasks' status was fetched with a subscription. When you do the changes and refresh your app again, all the tasks' text should now be visible.
106
106
107
107
## 3.2 Refetching Queries
108
108
@@ -112,9 +112,9 @@ If you try to add or remove a task, nothing will happen until you refresh the pa
112
112
113
113
Everything was working before (and still it is with the toggle) because we were getting the tasks using the `useTracker` that will automatically fetch the data again if something changes. But now, we're getting the tasks with GraphQL and after an action that changes something in the background, we need a way to call the query again. With GraphQL, we have a couple of ways of doing it.
114
114
115
-
For now, let's use the function `refetch` that's returned from the hook `useQuery`, alongside with the `data` and the `loading`.
115
+
For now, let's use the function `refetch` that's returned from the hook `useQuery`, alongside the `data` and the `loading`.
116
116
117
-
We'll need to pass forward this function to the `TaskForm` so we can call the query again as soon as the user adds a new task, and we need to call this function well someone tries to delete a task. The easiest way will be moving the delete function inside the `App` component.
117
+
We'll need to pass forward this function to the `TaskForm` so we can call the query again as soon as the user adds a new task, and we need to call this function well someone tries to delete a task. The easiest way will be to move the delete function inside the `App` component.
> Review: you can check how your code should be in the end of this step [here](https://github.com/meteor/react-tutorial/tree/master/src/simple-todos-graphql/step03)
172
+
> Review: you can check how your code should be at the end of this step [here](https://github.com/meteor/react-tutorial/tree/master/src/simple-todos-graphql/step03)
0 commit comments